Click to See Complete Forum and Search --> : Total qty per page in CR
erickwidya
Oct 22nd, 2004, 03:12 AM
hello..want to ask something
i want to count how may qty that display per page (the report have more than 1 page)..how can i do this?
thanks
Pasvorto
Oct 22nd, 2004, 10:04 AM
Do you mean you want to restrict the number of detail lines on a page... or just count how many detail lines printed on the page?
erickwidya
Oct 22nd, 2004, 08:57 PM
i want to restrict it..say 20 record per page..
and i want to count total qty per page (which qty for 20 record that displayed)..and display it at page footer?
ex:
id qty
1 2
. .
. .
. .
20 4
Total per page: 100
can i do this?
thanks
brucevde
Oct 25th, 2004, 04:31 PM
If you have not resolved these issues already, here is what I use.
Restrict number of detail lines
In the Format Section -> Details -> New Page Before - add this formula : RecordNumber Mod 20 = 0
Page by Page totals
You need to use a global variable and 3 formulas. One formula resets the global variable to 0, another sums the amount and still another is used to display the variable. Each Formula must have the exact same declaration for the Global variable. Obviously change CurrencyVar to your data type.
Create the following formula, I call it PageTotalReset, and place it in the Page Header section.
Global currencyVar PageTotalValue;
WhilePrintingRecords;
PageTotalValue := 0;
Create the following formula, I call it PageTotalAmount, and place it in the Details section.
Global currencyVar PageTotalValue;
WhilePrintingRecords;
PageTotalValue := PageTotalValue + {TableName.FieldName};
Create the following formula, I call it PageTotalDisplay, and place it in the Page Footer section.
Global currencyVar PageTotalValue;
WhilePrintingRecords;
PageTotalValue;
erickwidya
Oct 25th, 2004, 08:54 PM
thanks alot brucevde..i'm not familiar with coding in CR so i can't found out how to reset pageTotal for each Page (now i know it can be done :0)
i used this before RecordNumber Mod 20 = 0 .. this the right one to restrict 20 record per number but if i had a 2 group or more..then it show not the right one i need..coz it keep mod when the group change..how can i prevent this? do i have to use like the one u mention?
thanks for the reply
robbedaya
Mar 7th, 2005, 07:11 AM
insert Formula in Page header:
- Name: @ResetCounter
- Formula Body:
whileprintingrecords;
numbervar RecordCounter:= 0;
**********************************************
insert Formula in Body (Detail)
- Name: @RecordCounter
- Formula Body:
whileprintingrecords;
numbervar RecordCounter:= RecordCounter + 1;
***********************************************
Section expert - Detail - new page after
- Formula Body:
{@RecordCounter} = 20
***********************************************
To set the formula's invisible on the report:
right click on formula-field
-> Format Field...
-> tab: common
-> check Suppress
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.