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

Subreport Data - Calculations 2

Status
Not open for further replies.

govmule

MIS
Dec 17, 2002
90
0
0
US
Hello All,

I'm using Crystal Reports XI, hitting a MSSQL 2000 database. I have a report that displays two subreports. I would like to take the data from each subreports and make calculations like percentage. Is this possible? What is the formula syntax?

 
Within each sub, you would have to set up the value you want to use in the main report as a shared variable:

whileprintingrecords;
shared numbervar x := <yoursubvaluehere>;

Repeat, but change the variable name in the second sub, e.g., to "y".

Then in the main report, in a section below the ones containing your subreports, use a formula, e.g., like this:

whileprintingrecords;
shared numbervar x;
shared numbervar y;
x%y

If you are calculating at a group level, you should also reset your shared variables in additional formulas.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top