cancel
Showing results for 
Search instead for 
Did you mean: 

Chart Based on Results from Subreports

Former Member
0 Kudos

Using Crystal Reports XI

Trying to explain what I'm needing, so bear with me.

I have four subreports. Each of these subreports contains a shared variable that transfers the grand total to the main report. On the main report, I created a formula for each shared variable that returns the value from that shared variable.

I drop a chart in the Report Footer (where I want the chart to appear). In the Data tab of the Chart Expert, I add the four formula objects in the "Show Value(s)" section and select "For All Records" in the section above that.

Then I preview.

What I get is nothing. All four are showing 0% (and, of course, the pie is not showing).

If I drop the formula objects next to the chart, the values do show up, just not in the chart.

What am I doing wrong and how do I do what I want to do?

TIA

Accepted Solutions (1)

Accepted Solutions (1)

JWiseman
Active Contributor
0 Kudos

unfortunately you can't use shared variables from a subreport in a chart due to evaluation times.

here's what you can do though:

1) create a new subreport where you'll build the chart...make sure it brings back 1 record off of any table

2) link the new subreport to all 4 formulas where you brought back the shared variables to the main report...you don't need to link them to anything in the subreport...just create a one way link which will create a ?Pm parameter in the subreport

3) now go back to the subreport and just put the 4 new ?Pm parameters into the chart

i know it's a bit of a pain but it works.

cheers,

jamie

Former Member
0 Kudos

I'm sorry to say, it doesn't work.

The chart does not accept (or recognize) ?Pm parameters. What I did, though, was to create fromulas in the new chart subreport which would "pass-through" the parameters. These the chart object would recognize and I could add them in the "Show value(s)" list.

But the chart is not showing up. I can drop the formula objects that I created in the new subreport right next to the chart (same section) and see the values, they just aren't showing up in the chart itself.

JWiseman
Active Contributor
0 Kudos

sorry, of course you're correct that you need the formula to bring the subreport parameter into the chart expert.

you should be bringing back at least 1 record to the subreport in order for this to work.

otherwise i am not sure why it wouldn't be working as this is the best way to chart off of whileprintingrecords values like in the sample [here|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/17359].

Former Member
0 Kudos

I did bring back a record.

I discovered that I not only need to bring back a record, but I need to use at least one field within the record in the chart (as an "On Change Of" field, even though the field never changes).

It seems to be working now.

Thanks.

Answers (0)