Suppress Blank lines in report

whyaskqcnwhyaskqcn Member Posts: 22
I have created several footer bands, each band with different condictions for CurrReport.SHOWOUTPUT(). HOwever, I noted that blank lines are printed if the condition is false. Is there anyway I can suppress printing the blank lines?

Thanks for advice.

Comments

  • kinekine Member Posts: 12,562
    Have you the condition in OnPreSection or in OnPostSection?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • SavatageSavatage Member Posts: 7,142
    in the data item properties is the PrintOnlyIfDetail set to Yes?

    i'm not sure if that will help with the footers but worth a shot - unless someone knows for sure?
  • whyaskqcnwhyaskqcn Member Posts: 22
    Hi, both. Thanks for the suggestions. Just sharing the results I have obtained.

    the condition was set on the OnPreSection. Have tried with OnPostSection. No difference.

    PrintOnlyDetails - if set to Yes, at Sales Line, nothing gets printed at all even though there are details. When set at Sales Header, the document prints fine. However, the footer concerned still have a big gap -- due to the number of lines in the footer band.
  • afarrafarr Member Posts: 287
    I recall somewhere that Navision always leaves space for a section, whether it actually prints the text or not. A solution I know of involves creating a dataitem for each section (or at least a dataitem that covers all the footers, in your case).

    So, suppose your report has a Customer dataitem, with the following footer sections:
    Customer - Footer 1
      CurrReport.SHOWOUTPUT(Condition1);
    
    Customer - Footer 2
      CurrReport.SHOWOUTPUT(Condition2);
    
    Customer - Footer 3
      CurrReport.SHOWOUTPUT(Condition3);
    

    My solution is to create three new Integer dataitems, with DataItemTableView set to SORTING(Number) WHERE(Number=CONST(1)).
    Customer
    CF1 - Integer
    CF2 - Integer
    CF3 - Integer
    
    Note that the sections are not indented under Customer, so they will be triggered only after all the Customer records have been processed.
    Now in CF1 (and similarly for CF2, CF3) put the code
    IF NOT Condition1 THEN
      CurrReport.SKIP;
    
    (you might have to use BREAK instead of SKIP).

    There is a second alternative. It is not so useful if the footers have lots of controls, but suppose they just contain a label "This is Footer 1", "This is Footer 2", "This is Footer 3". Then the three footers could be replaced by a single footer with a textbox (instead of label) with SourceExpr = MyFooterTxt; you would then have the following code:
    [code]
    CASE TRUE OF
    Condition1: MyFooterTxt:= "This is Footer 1";
    Condition2: MyFooterTxt:= "This is Footer 2";
    Condition3: MyFooterTxt:= "This is Footer 3";
    END;
    [\code]

    I hope this is clear enough.

    Alastair
    Alastair Farrugia
Sign In or Register to comment.