Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Checkbox - Show more/less info

Posted on by Microsoft Employee

I have this report which I need a checkbox in. I got a check box but it doesn´t do anything. What I would like it to do is when it is marked,  that it shows full information and when it is not marked that it shows only "No."  and "Name" in the preview. Check my screenshots. I`ve been also working with NAV for a couple of months so keep it simple please :)2870.Bez-naslova.png1222.Bez-naslova2.png

*This post is locked for comments

  • Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Checkbox - Show more/less info

    You need to similar to the below post, the only difference you need to apply that to Column Visibility expression

    www.navisionworld.com/.../conditional-page-break-in-rtc-reports.html

  • Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Checkbox - Show more/less info

    Hi Macka,

    I've modified the syntax on the above post.

    Use := instead of =. You can use Report Builder it should work well.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Checkbox - Show more/less info

    Hi Olister. I`ll send you a screenshot of what I`ve done. Tell me if it is OK. it probably isn`t because I get an error (also in the screenshot).  

    Can I use a Visual Studio instead of SSSR or can I use Report Builder?

    Would I be asking too much if i asked you to take a screeen shot of how it is correct?

    Macka.pngMacka.png

  • Suggested answer
    Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Checkbox - Show more/less info

    Hi Macka,

    From what I understood your requirement is as follows

    1. Print Customer Details such as No.,Name,City,Posting Group and Balance which is Detailed View.

    2. Print Customer Data such as No. and Name in the Summarized/Less Detailed View

    Solution:

    1. Create a global variable say Details_Summarized of type boolean and populate this field on the request page.

    2. I've observed this that we cannot use Boolean type variable in the 'iif' query of SSRS so thus we convert it into Integer in the OnAfterGetRecord trigger in Code in C/AL in report design.So we declare an Integer type variable called TempDetailSummary We use the following

    If Details_Summarized = TRUE THEN

    TempDetailSummary := 1;

    //value 1 indicates to show the detailed view

    ELSE

    TempDetailSummary := 2;

    //Value 2 indicates to show the less detailed/summarized view

    And Pass the TempDetailSummary to DataItem as a column in Report Design(NAV Side) where you've declared which all fields are to be pass to SSRS Report.

    3. At the SSRS Side,

    Manually goto each column (which is supposed to be hidden in less detailed view) > Column visibility > Show or Hide based on Expression and use the following expression

    =iif(Fields!TempDetailSummary=1,True,False)

    4. Compile the report and test the report

    I hope it helps :)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Checkbox - Show more/less info

    Hi Olister,

    Could we start from the beginning because I`m confused with a lot of answers here. So let`s say I created report like from my first post with difference that it doesn`t have a check box. How do I now create a check-box and how do I achieve that in my window " edit my customer report " I have a check-box which when it is not marked  ( then I click preview) it shows only column " No. " and " Name" in the preview and when it is marked then shows all the columns?

  • Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Checkbox - Show more/less info

    Hi Macka,
    You need to hide the Address,City,Customer Posting Group,Balance??
    In that case, you need to
    Select the specific Column > Visibility > Show or Hide based on Expression > In Expression put the following code
    iif(Fields!HideRow=1,True,False).

    Sorry about detail row and total row, I misunderstood to be total of Balance my bad.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Checkbox - Show more/less info

    Hi Olister, how do I create a Details Rows and a Total Row in Layout?

  • Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Checkbox - Show more/less info

    Hi Macka,

    First of all you've to create a Details Rows and a Total Row in Layout.
    Now,

    In OnAfterGetRecord, create a Global variable of type Integer say HideRow and write the following code

    IF MyTest= TRUE THEN

    HideRow = 1; //Hide

    ELSE IF MyTest=FALSE THEN

    HideRow = 2; //Visible

    and pass the HideRow variable as Column in Report Design

    Now in Layout,

    Right Click on Row you want to hide of show > Select Row Visibility > Show or Hide based on an Expression > In Express write the following code

    iif(Fields!HideRow=1,True,False)

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Checkbox - Show more/less info

    You need to pass the variable to the dataset, like how you have passed the other columns and then use that value to control the visibility of the columns on the report. 

    check this example

    http://bhushan.extreme-advice.com/conditionally-setting-column-visibility-in-ssrs/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans