Options

How to put customization on trial balance report version 2015

T222T222 Member Posts: 63
I have the following customization in trial balance report on version 5.
under sections of report - integer Body 2 - Presection

IF CurrReport.SHOWOUTPUT THEN BEGIN
IF ("G/L Account"."Balance at Date"=0) THEN BEGIN
IF ("G/L Account"."Balance at Date" <> "G/L Account"."Net Change") THEN
CurrReport.SHOWOUTPUT(TRUE)
ELSE
CurrReport.SHOWOUTPUT(FALSE);
END;
END;

How can I transfer this customization to Navision 2015?

Thanks in advance

Best Answer

  • Options
    rsaritzkyrsaritzky Member Posts: 469
    Answer ✓
    Hi,
    In NAV2013 and later, the equivalent of SHOWOUTPUT on sections is controlled in the report layout. One way to do this is create a variable in your report, and set the value in the dataitem that creates the line similar to what is in the Section code now, e.g. create a variable HideBalance (type boolean), then:
    IF ("G/L Account"."Balance at Date"=0) THEN BEGIN
      IF ("G/L Account"."Balance at Date" <> "G/L Account"."Net Change") THEN
        HideBalance := FALSE
    ELSE
        HideBalance := TRUE;
    END;
    

    Note the TRUE/FALSE is "opposite" of SHOWOUTPUT, i.e. if TRUE, it will hide, if FALSE, it will show (see below)

    Then, in the Report Layout, you can set the visibility of a line based on this value - it depends on which RDLC report editor you use. If you are using Report Builder (the free "built-in" editor that comes with NAV), right-click on the very left of the row you want to show/suppress in the little box with 3 parallel lines and choose "Visibility" and click on the "fx" under "Show or hide based on an expression"

    On report 10022, most of them will already have an expression, but you can add to it or replace it. The syntax is:
    =Fields!HideBalance.Value
    

    If there is already an expression, you can add to it, e.g. here's one from the NAV2016 version of report 10022 for DescriptionLine2 (the one with 4 columns):
    =Not(Last(Fields!IntegerBody9Condition.Value, "table2_Group_GLAccount"))
    

    If you wanted to additionally hide/display with your code, you could add it, e.g.
    =(Not(Last(Fields!IntegerBody9Condition.Value, "table2_Group_GLAccount"))) OR (Fields!HideBalance.Value)
    

    There are many options for doing this - this is only one idea. I'm sure there are others out there.

    Good luck!

    Ron
    Ron

Answers

  • Options
    krikikriki Member, Moderator Posts: 9,090
    [Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    rsaritzkyrsaritzky Member Posts: 469
    Answer ✓
    Hi,
    In NAV2013 and later, the equivalent of SHOWOUTPUT on sections is controlled in the report layout. One way to do this is create a variable in your report, and set the value in the dataitem that creates the line similar to what is in the Section code now, e.g. create a variable HideBalance (type boolean), then:
    IF ("G/L Account"."Balance at Date"=0) THEN BEGIN
      IF ("G/L Account"."Balance at Date" <> "G/L Account"."Net Change") THEN
        HideBalance := FALSE
    ELSE
        HideBalance := TRUE;
    END;
    

    Note the TRUE/FALSE is "opposite" of SHOWOUTPUT, i.e. if TRUE, it will hide, if FALSE, it will show (see below)

    Then, in the Report Layout, you can set the visibility of a line based on this value - it depends on which RDLC report editor you use. If you are using Report Builder (the free "built-in" editor that comes with NAV), right-click on the very left of the row you want to show/suppress in the little box with 3 parallel lines and choose "Visibility" and click on the "fx" under "Show or hide based on an expression"

    On report 10022, most of them will already have an expression, but you can add to it or replace it. The syntax is:
    =Fields!HideBalance.Value
    

    If there is already an expression, you can add to it, e.g. here's one from the NAV2016 version of report 10022 for DescriptionLine2 (the one with 4 columns):
    =Not(Last(Fields!IntegerBody9Condition.Value, "table2_Group_GLAccount"))
    

    If you wanted to additionally hide/display with your code, you could add it, e.g.
    =(Not(Last(Fields!IntegerBody9Condition.Value, "table2_Group_GLAccount"))) OR (Fields!HideBalance.Value)
    

    There are many options for doing this - this is only one idea. I'm sure there are others out there.

    Good luck!

    Ron
    Ron
  • Options
    T222T222 Member Posts: 63
    Thank you !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Sign In or Register to comment.