Results 1 to 6 of 6

Thread: Total qty per page in CR

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    Total qty per page in CR

    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

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    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?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818
    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
    Last edited by erickwidya; Oct 22nd, 2004 at 09:02 PM.

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    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;

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818
    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

  6. #6
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872

    Re: Total qty per page in CR

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width