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!

grand total showing wrong numbers 1

Status
Not open for further replies.

namas

Technical User
Aug 31, 2006
31
US
1) How to calculate GrandTotal of shared variable?
Currently it's calculating wrong. Fields are grouped by 'account' field.

In Group Header section

formula @GetBeginningBalance=

whileprintingrecords;
shared numbervar BeginBalance;
BeginBalance;

In Detail Section (suppressed)

whileprintingrecords;
numbervar BeginBalanceGrandTotal:= BeginBalanceGrandTotal + {@GetBeginningBalance};

{@GetBeginningBalance};;



In Report Footer section

whileprintingrecords;
numbervar BeginBalanceGrandTotal;


2) How to calculate GrandTotal with formula field?

In Group Header section

formula @YTDTotal =
{@GetBeginningBalance} + {@CalculateBalance}

In Detail section (suppressed)

whileprintingrecords;
numbervar GrandYTDTotal:=GrandYTDTotal+ {@YTDTotal};

{@YTDTotal};

In report footer section

whileprintingrecords;
numbervar GrandYTDTotal;
 
Formula one refers to a shared variable, is there a subreport prior to this section?

Otherwise it isn't going to add anything. You need to provide adequate explanations of your formulas, it looks as though it's designed to do nothing...

Rather than showing us broken formulas, which all we can do is agree that they're broken, show example data and the fields, the names of the group fields, and what you epect as output.

If I posted with:

I get this:

"&*(($@"

Can you fix it?

You'd have no idea of the source and what I want, so take the appropriate steps to define those key aspects first.

The premise for totaling a shared vairable from a subreport is as follows for a subreport placed in a group header:

Group header A: Subpreort executes.
Group Header B: Formula;
whileprintingrecords;
Shared Numbervar Subreporttotal;
numbervar GrandTotal"=GrandTotal+Subreporttotal;

Then in the report footer you can display the grand total:

whileprintingrecords;
numbervar GrandTotal"=GrandTotal+Subreporttotal;

If you're trying to total a subreport shared value from a subreport placed in the details and display at a group footer, use:

Group header
whileprintingrecords;
Shared Numbervar Subreporttotal:=0;
numbervar GrandTotal:=0;

Right click the details and select insert section below, place the subreport in the upper section and the following formula in the lower details section:

whileprintingrecords;
Shared Numbervar Subreporttotal;
numbervar GrandTotal=GrandTotal+Subreporttotal;

Then in the group footer palce:
Shared Numbervar Subreporttotal;
numbervar GrandTotal

Hard to say what you want or you're attempting to do, you just post bad formulas and assume that we know what data you have and what you expect as output...

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top