Forum Discussion

Menawhile's avatar
Menawhile
New Member
1 year ago
Solved

Power BI Report Server Export to PDF + Visibility Toggle

Hej, 

 

I hope this wasn't asked before but I did not find anything about it. 

I do have a Report Builder Report where visibility can be toggeled through the row group above BUT I also need it to show everything when exported to PDF - using =IIf(Globals!RenderFormat.Name = "PDF", False, True) as expression

As for my problem:
I go to preview and the report is shown, toggles work. As long as I don't expand anything in the report, the PDF Export works fine and everything is shown. 
BUT as soon as I expand something the PDF Export is missing those rows. I kinda came to the conlcusion that the toggle overwrites my expression and I haven't found any way to make this work. 


In short what I need is:  
PDF Export showing everything

Toggle for Report Builder still working

Thanks in advance if you have any idea how I could make this work! 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thank you Expiscornovus 

    Hi, Menawhile 

    I found a solution:

    Here's a reproduction of the issue:

    Your current issue:

    Here's the solution:

    Start by clearing the expressions in your original matrix:

    =IIf(Globals!RenderFormat.Name = "PDF", False, True) 

    Then, make a copy of this matrix:

    Add the following show hidden expression to the copied matrix as a whole:

    After adding this expression, normally when we view the report it is hidden:

    Then add an expression to the toggle of this copy matrix:

    In this way, this hidden copy matrix will be printed when we export the pdf:

    Next, we need to hide the original matrix and then place the copy matrix in the position of the original matrix:

    When we print, this original matrix will be hidden:

    Overlapping the two matrices together is shown in the following figure:

    Whether we expand it or not, we export the PDF with all the data:

    In summary, the matrix we exported is a hidden identical matrix, and when the user expands the original matrix, it does not affect the entire hidden matrix. A PDF of the export results showing all the data each time was obtained.

     

     

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

3 Replies

  • Expiscornovus's avatar
    Expiscornovus
    Most Valuable Professional

    Hi Menawhile,

     

    Maybe you can use a report parameter for this to see if that makes a difference?

     

    Something like the below (in that case the parameters is called ShowAllRows)

    =IIf(Globals!RenderFormat.Name = "PDF" And Parameters!ShowAllRows.Value = True, False, True)

     

  • Hej Expiscornovus

     

    can you elaborate on this? What exactly would the parameter do? How do I get it to show all rows and I would to have to trigger it manually, wouldn't I?

    Thanks for your help!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you Expiscornovus 

    Hi, Menawhile 

    I found a solution:

    Here's a reproduction of the issue:

    Your current issue:

    Here's the solution:

    Start by clearing the expressions in your original matrix:

    =IIf(Globals!RenderFormat.Name = "PDF", False, True) 

    Then, make a copy of this matrix:

    Add the following show hidden expression to the copied matrix as a whole:

    After adding this expression, normally when we view the report it is hidden:

    Then add an expression to the toggle of this copy matrix:

    In this way, this hidden copy matrix will be printed when we export the pdf:

    Next, we need to hide the original matrix and then place the copy matrix in the position of the original matrix:

    When we print, this original matrix will be hidden:

    Overlapping the two matrices together is shown in the following figure:

    Whether we expand it or not, we export the PDF with all the data:

    In summary, the matrix we exported is a hidden identical matrix, and when the user expands the original matrix, it does not affect the entire hidden matrix. A PDF of the export results showing all the data each time was obtained.

     

     

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.