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

creating total for shared numvar 1

Status
Not open for further replies.

suburbanites

Programmer
Aug 16, 2007
75
US
Hi, I'm using CRXI SP1

Any ideas on how to create a running total or a summary total in the main for a shared number variable coming from a subreport? I do a right click on the field and there is no insert available for the running or summary totals. I also cannot find the shared variable when I went to cerate a formula. Thanks for any input..
 
You have to create another shared variable in your subreport which acts like a running total. ie is not reset inside your subreport.

Ian
 
If you have a shared variable setup in your subreport, e.g., something like:

whileprintingrecords;
shared numbervar x := sum({table.amt};

and your sub is in a group section and you want a report level total of the shared variable, then you can do the following. In the main report, in a section below the one in which your subreport is located, e.g., GH_b if your sub is in GH_a, place a formula like this:

whileprintingrecords;
shared numbervar x;
numbervar y := y + x;

Then in your report footer, place a display formula:

whileprintingrecords;
numbervar y;

If your sub can sometimes be null, add a reset formula in the report header and in the group footer:

whilepintingrecords;
shared numbervar x := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top