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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphing data from a main report and subreport

Status
Not open for further replies.

JudyL

Instructor
Feb 21, 2001
148
US
Is there a way in Crystal Reports XI to take data coming from a subreport as a variable and graph it with data from a main report?
 
To pass data back from a subreport, use a shared variable. For a date, put a formula field in the subreport like
Code:
Shared dateVar 
V_Today := {LoadStatus.LastDLoad}
To access it in the main report, create another formula field with
Code:
Shared dateVar 
V_Today := V_Today

If it was a currency value, you'd do it differently, e.g.
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved:={#TotSaved};
SumSaved
And to access it in the main report, create another formula field with
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved

Note that the shared variable is only available in the section after the section which contains the subreport.

If you put the shared variable value into a formula field at detail level, it should allow you to graph it.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I know how to do that. It's using that data in a graph. It won't let you use the data in the graph. It does not list the fields that are formulas in the chart expert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top