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

Dear Sir I have a report to be cre

Status
Not open for further replies.

kalpsv

Programmer
Jun 12, 2002
58
IN
Dear Sir
I have a report to be created with grouping statewise.
I get the data grouped statewise.but when I have to
total the data for all states i.e. grand totol of the
field subscription the running totals formula totals
for all the states except for the last one.
The formula which I use in the group header is

WhilePrintingRecords;
Numbervar op;
Numbervar grandop;
grandop:= grandop + op;
op := 0;

The following is the formula i use in details column

WhilePrintingRecords;
NumberVar op;
NUMBERVAR GRANDOP;
op :=op+ToNumber({@OPBALTOT})+ToNumber({@LIABVAL});

The formula in the group footer/grandtotal column
is

WhilePrintingRecords;
NumberVar grandop;

I feel the problem lies like this:
Initially the op is set to 0
Then it has to total the data for the first state and display in the grandop;but it is displaying only 0
after the first state grouping.
Can you help me sir
If you do need any clarification I would like to provide
the same
bye for now
kalps

 
The problem is that you never identify the grandop variable in the 'evaluation' formula. Unless you've misstated your issue, I don't believe you need two variables. I've modified your formulas as follows:

//Group Header
WhilePrintingRecords;
Numbervar grandop := 0;


//Detail Section
WhilePrintingRecords;
NumberVar grandop := grandop+ToNumber({@OPBALTOT})+ToNumber({@LIABVAL});


//Group Footer
WhilePrintingRecords;
NumberVar grandop;

grandop;
 
To rhinok (TechnicalUser)

I had used two variables for the following reason:
op variable is to total for each state
grandop variable is grandtotal for all the states.

Even then i used your formulas
it worked for each state and not for grand total

kindly guide me
bye for now
Kalps
 
I recreated your formula with some of my own data, and as Rhinok suggested, you need to add the following to your evaluation formula:

grandop := grandop + op;

But grandop should not be reset to 0 in the group header. Use your original formula and just add the line above to the formula you put in the detail section.

To display both the state subtotal (op) and the cumulative total (grandop) in the group footer, I think you need two separate formulas:

Whileprinting records;
Numbervar Op;

Whileprinting records;
Numbervar Grandop;

-LB
 
lbass

Thank you and it worked

bye for now

kalps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top