Last post Jun 29, 2016 07:19 AM by Yohann Lu
Jun 09, 2016 01:04 PM|rpfinnimore|LINK
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>
...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
Jun 10, 2016 04:29 AM|Yohann Lu|LINK
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">
Jun 14, 2016 07:11 PM|rpfinnimore|LINK
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?
Jun 17, 2016 10:15 AM|Yohann Lu|LINK
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.
Jun 20, 2016 12:50 PM|rpfinnimore|LINK
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
Jun 29, 2016 07:19 AM|Yohann Lu|LINK
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: