locked
SSRS reporting does not display when containing <div> made visible RRS feed

  • Question

  • User1395831461 posted

    I have a site consisting of div s that are made visible="true" or visible="false" based on what buttons the user operates.  One of the div s contains a ReportViewer...

        <div id="divReports" runat="server" visible="false">
    
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Visible="true" ShowReportBody="true" ShowToolBar="true">
                <ServerReport ReportServerUrl="http://sqlreps/ReportServer" ReportPath="/Report1"></ServerReport>
            </rsweb:ReportViewer>
    
    
        </div>
    

    ...the problem being that when the button is operated to make divReports visible="true" in the codebehind the report does not display.  No exception is thrown and nothing shows up in the debug output but the page is just empty.  If I change the code so that the div divReports is visible="true" when the site is first accessed the reporting displays on the page just fine.

    Can someone kindly show me what I need to do to make the report display on the page when the button is operated to make divReports visible="true"?  Thanks tonnes for any help, Roscoe

    Thursday, June 9, 2016 1:04 PM

Answers

  • User36583972 posted

    Hi rpfinnimore,

    There are two ways to solve this issue.

    1: Postpone setting the report definition until you make the ReportViewer visible.

    2: When making the ReportViewer visible, also make a trivial change to the ReportViewer to trigger a definition change.  The easiest way to do this is to toggle the value of ReportViewer.ProcessingMode (e.g. set it from Remote to Local then back again).

    You can refer the following detailed description and solutions

    The Invisible ReportViewer:

    https://blogs.msdn.microsoft.com/brianhartman/2010/11/16/the-invisible-reportviewer/

    Best Regards,

    Yohann Lu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 29, 2016 7:19 AM

All replies

  • User36583972 posted

    Hi rpfinnimore,

    From your description, you can try the following suggestions.

    1: Use ReportViewer1.ShowReportBody

    ReportViewer1.ShowReportBody = false;
    ReportViewer1.ShowReportBody = true;

    2: set Div Visibility.

    <div id="DIV" runat="server" >
        <rsweb:ReportViewer ID="ReportViewer1" runat="server">
        </rsweb:ReportViewer>
    </div>

    3: Make a DIV visible and invisible with JavaScript

    http://stackoverflow.com/questions/9456289/how-to-make-a-div-visible-and-invisible-with-javascript

    http://stackoverflow.com/questions/18379894/how-to-set-visible-property-for-div-in-javascript

    Best Regards,

    Yohann Lu

    Friday, June 10, 2016 4:29 AM
  • User1395831461 posted

    I think it has something to do with the button causing a postback.  I need to reload the report.  Can someone show me how to do that?

    Tuesday, June 14, 2016 7:11 PM
  • User36583972 posted

    Hi rpfinnimore,

    May be you can define a global variable. When you click a button and change the global variable value. Then, in psotback (page_load) event, you can set divReports  visible="true/false" based on the global variable.


    Best Regards,

    Yohann Lu

    Friday, June 17, 2016 10:15 AM
  • User1395831461 posted

    Thanks for the reply Yohann Lu but that does not work either.

    I also tried adding the text "top" to the top of the <div> and "bottom" to the end of the <div> when the button to make the <div> visible=true the text "top" appears, followed by the space that should be displaying the ReportViewer (which is empty) followed by the text "bottom".

    So it looks like the visibility of the <div> is not the issue.

    As I wrote before when the div is made visible=true on first load of the site the ReportViewer show up fine and even after the button was operated.

    Can someone explain what is going on?  Thanks tonnes for any help, Roscoe

     

    Monday, June 20, 2016 12:50 PM
  • User36583972 posted

    Hi rpfinnimore,

    There are two ways to solve this issue.

    1: Postpone setting the report definition until you make the ReportViewer visible.

    2: When making the ReportViewer visible, also make a trivial change to the ReportViewer to trigger a definition change.  The easiest way to do this is to toggle the value of ReportViewer.ProcessingMode (e.g. set it from Remote to Local then back again).

    You can refer the following detailed description and solutions

    The Invisible ReportViewer:

    https://blogs.msdn.microsoft.com/brianhartman/2010/11/16/the-invisible-reportviewer/

    Best Regards,

    Yohann Lu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 29, 2016 7:19 AM