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

charting a simple addition formula

Status
Not open for further replies.

jj1576

MIS
May 21, 2008
69
US
Maybe there is an easier way to do this, I have a simple formula: Called TotalC that reads:

shared numbervar matha - shared numbervar mathb;

Matha and mathb are from subreports. I just want to graph this @totalc field in the main report. Of course, @totalc won't show up in the chart expert- does anyone know a workaround for this when sub-reports are involved?

Thanks
 
What version of crystal? Please post the entire formula for {@TotalC}, as well as any embedded formulas. Can the subreport have the graph in it? Are you sure you need a subreport?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
dgillz,

Thanks for the response. I'm pretty certain that I need the sub-report because the data is arranged across the top in a row like so:

28 26 2 44 42 2 178 etc.

These numbers are all from the same field in the database testresults.resulttext. The thing that differentiates them is the value of another field they are linked to. So I need a sub-report for each selection criteria- unless there is another way to do this. It is fine to but the graph data in another subreport, but it still doesn't let me.

The CTotal (it is the third result in the row above) formula is as follows:

shared numbervar totalc:=
shared numbervar matha - shared numbervar mathb;

The workaround in business objects works for one graph, but because I have a graph each time the field table.reference changes, it doesn't add right. It accumulates the totals instead of resetting each time the field changes.

Thanks
 
Does the field reference change in a different report section? It sounds like you just need a reset formula for the shared variables.

-LB
 
lbass,

Thanks for the prompt response. You are right, I just a reset formula- however, I'm not sure where to apply it- The reference field is actually group 4 in the main report. The graph is in a sub-report that is in the group footer of group #4. From this do you know a reset formula for these variables?

Thanks.
 
But where are the subs located that provide the values for the shared variables that referenced in GF4?

-LB
 
lbass,

Those subs are in the details section of the main report.
 
whileprintingrecords;
shared numbervar matha;
shared numbervar mathb;
shared numbervar ctotal;
if not inrepeatedgroupheader then (
matha := 0;
mathb := 0;
ctotal := 0
);

Try placing the above reset formula in GH4.

-LB
 
lbass,

Thanks for the response- I actually figured it out by resetting the formula that is passed to the graph sub-report from the workaround, which is:

stringvar strshowvalue;
strshowvalue := strshowvalue + totext({@Total C}) + "^"

I reset it with:

whileprintingrecords;
stringvar strshowvalue := ""

this actually reset the graph- probably does the same thing your formula does. Thanks very much for your quick responses through all of this.





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top