Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing Graphs In Crystal

Status
Not open for further replies.

aap96126

Technical User
Apr 15, 2005
13
GB
Hi

I have created a set of arrays in my Crystal report. I now need to draw a graph of these array values in Crystal, but I can't seem to do this when I try to construct a chart.

Does anyone have any ideas how I can do this?

Many thanks.
 
aap96125 ...

You cannot graph on arrays ... can you be more specific about what you are doing? Also, crystal version is most helpful.

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Hi

Thanks Rosemary. I am running Crystal V9. I need to calculate a 12 month rolling figure (i.e. the sum of the previous 12 months' numbers). I have done this using an array. I now need to graph these 12 month rolling figures to examine the trend for each month. But the formula I have used to calculate the arrays is not a field which can be "graphed" on. Hence my problem.

Thanks for your help.

Cheers

John.
 
Dear John,

Ok ... are you stating that the array contains the sum of some column/data, one element in the array representing each month?

If so, then I would create 12 separate formulas. For example, 01_Mo, 02_Mo and so on. Now the sum of these formulas can be used in a chart to do exactly what you state.

Here is an example from one of my reports, where I have done a "manual crosstab". I generate the column header in one formula and then in another and check the date of my record to see if it in the range of that month and print a 1 or 0... you could change the then 1 else 0 part to then {table.Column} holding the value for that month.

The nice thing about this is that I can group my report by whatever I want and get grandtotals for the month and summaries at each group level.

I can also chart on the data.

Here is the formula for the column header:

dateadd("m", -12,{?Pm-@ReferenceDate})

I just place that on my report and format it to show Month only.

Next, is 01_Mo formula and represents the month that is 12 months from the reference date parameter (I prompt user for "Run As" date).

if {Incident.Open Date & Time}
in
CDATE(
Year(dateadd("m", -12,{?Pm-@ReferenceDate})),
Month(dateadd("m", -12,{?Pm-@ReferenceDate})),01)
to
cdate(
dateadd("M",-11,cdate(year({?Pm-@ReferenceDate}),month({?Pm-@ReferenceDate}),1))-1
)
then 1
else 0

I hope that helps...

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Hi Rosemary

It's the end of the day here and I'm about to head home. I'll try to apply your method first thing tomorrow when I come in.

Many thanks for your time and help.

Cheers!

John.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top