double header and body of the same data item-Reports

naushienaushie Member Posts: 33
Well i have a problem like this:
since i can take 2 headers/body section of the same dataitem.
now the question is this
Can i print the other header/body on the next page.
like first one prints on one page and other one prints on the next new page?
Naushad Alam
Consultant -Navision

All e Technologies (P) Ltd.
Building Solutions for Extended Enterprises

www.alletec.com

Comments

  • Dean_AxonDean_Axon Member Posts: 193
    Yes you can.

    If you want to print alternative pages then do a check on the page no. in the OnPreSection:
    If PAGENO=1 or
       PAGENO=3 or
       PAGENO=5 or
       PAGENO=7 or
       PAGENO=9 or
       PAGENO=11 or
       etc..... you get the idea
      then currreport.showoutput(True)
    else
      CurrReport.ShowOutput(False);
    
    Then in the OnPreSection of the next data item
    If PAGENO=2 or
       PAGENO=4 or
       PAGENO=6 or
       PAGENO=8 or
       PAGENO=10 or
       etc.....   then currreport.showoutput(True)
    else
      CurrReport.ShowOutput(False);
    
    Thats one way :D

    You could always use a boolean check:
      Create 2 boolean Variables:
        OddPagePrinted
        EvenPagePrinted
    
    OnPreSection (of your odd page section)
      CurrReport.Showoutput(EvenPagePrinted);
    
    OnPostSection
      OddPagePrinted:=True;
      EvenPagePrinted:=False;   
    
    OnPreSection (of your even page section)
    CurrReport.Showoutput(oddPagePrinted);
    
    OnPostSection
      EvenPagePrinted:=True;
      OddPagePrinted:=False;   
    

    Same result, just different ways to do it. The first would be easier to debug, but the second is much shorter to write :wink:
    Remember: Keep it simple
  • afarrafarr Member Posts: 287
    Dean's example can be modified to cater fo all odd numbers like this:
    IF (PAGENO MOD 2) = 1 THEN
       CurrReport.SHOWOUTPUT(TRUE)
    ELSE
       CurrReport.SHOWOUTPUT(FALSE);
    

    An even shorter version, maybe slightly more difficult to read, is:
    CurrReport.SHOWOUTPUT(PAGENO MOD 2 = 1);
    

    For even pages, use
    CurrReport.SHOWOUTPUT(PAGENO MOD 2 = 0);
    

    Alastair
    Alastair Farrugia
Sign In or Register to comment.