473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Bar chart report

Hi all,
I have a very simple report, with say two fields: [Name] and [Performance]. What i would like to do is add a colored bar to every record (in the detail section)that gives an immediate visual indication of how large the performance is for the particular item. As the report only exists of 50 records i get a nice barchart at the end.
Any help would be greatly appreciated,
Leonard
Mar 3 '08 #1
5 3231
sierra7
446 Expert 256MB
Hi Leonard
Why can't you just use the Chart Wizard when building a Form or Report? It will give you step by step instructions to construct your chart.

By default it will display 'Sum of Performance' but this will not matter if you only have one value for each Name.

S7
Mar 3 '08 #2
Thanks for the response Sierra7. Maybe i oversimplified by stating to have two records only. I have a couple more fields per record and i want the (only one single) bar to appear at the right end of every record: [Field1],[Field2],[Field3],[BAR]
I guess printing a complete chart in the detail section does not give the result i like. Or am i missing something?
Cheers,
Leonard
Mar 4 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
Thanks for the response Sierra7. Maybe i oversimplified by stating to have two records only. I have a couple more fields per record and i want the (only one single) bar to appear at the right end of every record: [Field1],[Field2],[Field3],[BAR]
I guess printing a complete chart in the detail section does not give the result i like. Or am i missing something?
Cheers,
Leonard
Hi Beerbrewer. I did something similar a while back in devising a Gantt chart view for an action plan database. It can be done by placing a rectangle in the detail section of your report and formatting it to have the colour and style you want, then in the OnFormat event of the detail section you set the width of the rectangle control. To do this you need to estimate the remaining width of the detail section in twips. I set the overall width on report open.

The on format code below plots a grey bar on the detail section with variable start and end points. You don't need the variable start point, but you'll see that its not difficult to do.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2.     Dim XDays As Long 
  3.     XDays = MaxDay - MinDay + 1
  4.     XStart = Me!Marker.Left
  5.     XWidth = 7860 'twips available for marker
  6.     XScale = XWidth / XDays
  7. End Sub
  8.  
  9. Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
  10.     Dim CStart As Long, CEnd As Long
  11.     CStart = Me![Starts]
  12.     CEnd = Me![Ends]
  13.     XOffset = (CStart - StartDate) * XScale
  14.     XWidth = (CEnd - CStart + 1) * XScale
  15.     Me!Marker.Left = 0
  16.     Me!Marker.Width = XWidth
  17.     Me!Marker.Left = XStart + XOffset
  18. End Sub
Screenshot should be attached to show what report looks like.
-Stewart
Attached Images
File Type: jpg ScreenHunter_10.jpg (17.9 KB, 544 views)
Mar 4 '08 #4
Thanks Stewart, it is indeed what i have in mind! Actually i had been thinking about a sizable rectangle. However, i managed to make tiny barcharts now. The only thing is that for each chart per record my rather slow query is evaluated again and than matched on the form (parent-child link property).
My question has reduced to a very basic one: is it possible to link a chart to a value/control/field in the same record on the same report? I have been looking with a colleague for an hour now without success, so now i am rather curious whether this is actually possible (as it is i.m.o. quite straightforward it should be).
Thanks,
Leonard
Mar 4 '08 #5
sierra7
446 Expert 256MB
Hi
Nice chart Scott! I do something similar on screen for a CRM front end.

In quite a lot of my 'charting' I create a 'temporary' table to hold the data; which is quite often derived from complicated queries. The chart is then based on this simple table.

This also gives me the opportunity to check the numbers used for the charts.
If the chart is to be run regularly, the table is usually kept 'permenently' and I delete '*' from it each time before appending the new data.
This might speed-up your processing times Leonard.
S7
Mar 6 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: wangyang | last post by:
I designed a crystal report by Microsoft Visual Studio .NET (Version 1.1),and I inserted a chart in the report. All Text Font are "Arial" in the chart. I viewed the report in web application and...
1
by: Jim | last post by:
I have this chart on a form. I'm trying to get this chart to render only if the user chooses to do so. This because of that the chart is quite complex and takes some time to render. I know that I...
4
by: Andy Davis | last post by:
I have developed a number of reports that are based on parameter queries where the user enters criteria such as a date range and a sales rep say. I want to be able to show a graphical picture in...
3
by: StBond | last post by:
Hi everyone, I am new to Access and Visual Basic so things my be getting across a bit cloudy. I only started using VB for one week. I am having a little problem with the database that I am...
9
by: Patrick.O.Ige | last post by:
I have a code below and its a PIE & BAR CHART. The values now are all static but I want to be able to pull the values from a database. Can you guys give me some ideas to do this? Thanks ...
1
by: Robin Tucker | last post by:
Heres and interesting problem: I have a VB.NET program that creates reports via. Word Automation. This all works fine. What I want to do as part of this report generation process is to embed a...
8
by: dkelly | last post by:
I wish to create a report with a chart, but I want to use a SQL statement as the source of the data, using VBA code in the reports load event I found the following snippet Dim objGraph As...
0
by: Gilberto Avila | last post by:
I'm currently developing a web application with ASP .NET 1.1. I'm using the bundled Crystal Reports in Visual Studio 2003 to create reports for this application. The system specification requires...
0
by: cowboyjunkey | last post by:
This is what I want to do: Each report page will list some details about a sample (like time sampled, where, who sampled) and below it a chart showing the distribution of the sample (i.e....
1
by: Neil Ginsberg | last post by:
Anyone have an idea as to why an MS Graph chart would cause a report to repeat for 27 pages? I have a report which consists of a few labels in the header, and a single chart in the Detail section....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.