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

If I want to create a Group that is Group by page,Is that feasible?

Status
Not open for further replies.

DeanLai

MIS
Jun 14, 2010
5
TW
Hi, Expert
I want to limit record number(50 records) per page,
and it will have a total column which is amount Salary,
so now I had set some formulas into report

First(in report Details)
------------------------------------------------------------
WhilePrintingRecords;
Global numbervar DataCount := DataCount + 1;

ps.This variable counts record number and limits record within 50 records per page
when record passover 50, it will re-set variable to 0(this formulas set in Group Footer)
------------------------------------------------------------
second(in Group Footer)
------------------------------------------------------------
WhilePrintingRecords;
Global numbervar DataCount := 0;

ps.for re-set variable
------------------------------------------------------------
third(New Page After)
------------------------------------------------------------
Truncate ({@DataCount}/50)*50={@DataCount} and OnLastRecord=false

ps.For Next page
------------------------------------------------------------
Fourth
------------------------------------------------------------
WhilePrintingRecords;
Global numbervar pagetol;
salarytol:=salarytol +{table;1.amount}
------------------------------------------------------------
Fifth
------------------------------------------------------------
Global numbervar pagetol;
if (Truncate ({@DataCount}/50)*50)={@DataCount} then
pagetol:=0;
------------------------------------------------------------

If I want to create a Group that is Group by page(50 records per page), because I want
to grand total of salary per page,Is that feasible?
How to achieve this goal??

Thanks & Regards
 
Instead of grouping, use the page footer section, with a reset formula in a lower page footer section_b or in a page header section.

-LB
 
Thanks lbass

Actually, my care is Report View,
my report will have Three Summary columns,
one is for 50 records,
second is for data type,
another is for all of records.
I will put the First Summary column behind(below) the last records
So it will look like "Grand total"(for 50 records 1 total).
And the Second Summary column will lay on Group footer(sum data group by data type).
And the last Summary column will lay on every page's bottom(sum all of data).
If I put first summary column in page footer, It will lay on bottom of page, not behind the last records(per fiftieth record).
So I think if I create group1 for 50 records(put in first Summary column on group1 footer) and group2 for data type(put in second Summary column on group2 footer),
then put the last summary column into page footer. Maybe, it will look like what i want.


Thanks & Regards
 
You can try grouping on a formula like this to get the 50 records per group instance for your outer group:

whilereadingrecords;
numbervar cnt := cnt + 1;
numbervar i;
if remainder(cnt-1,50) = 0 then
i := i + 1;
i

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top