When my report has too much data, it will display "time out" error message. But I want to catch it and display with more friendly message.
So I add reportViewer.ReportError += viewReport_ReportError; event. But it failed to display ErrorLabel text. Is there anyone know how to display that?
It always display the timeout error message and parameter panel is hidden. ErrorPanel and ErrorLabel are hidden too.
protected void viewReport_ReportError(object sender, ReportErrorEventArgs e) { if (e.Exception.Message.Contains("time-out")) ErrorLabel.Text = "test"; else ErrorLabel.Text = "error"; ErrorLabel.Visible = true; ErrorPanel.Visible = true; Panel1.Visible = true; radPanelBar.Visible = true; reportViewer.Visible = false; e.Handled = true; }
<asp:Panel ID="ErrorPanel" runat="server" Height= "30px" Width="100%" Visible="false" Style="left: 0px; position: relative; top:0px;" Wrap="False" BackColor="WhiteSmoke">
<asp:Label ID="ErrorLabel" runat="server" Style="position: relative" Width="100%" Font-Names="Verdana,Sans-Serif" Font-Size="10pt"></asp:Label>
</asp:Panel>
<rsweb:ReportViewer ID="reportViewer" runat="server" cssClass="ReportStyle" AsyncRendering ="false"
Height="700px" Width="100%" ProcessingMode="Remote"
ShowParameterPrompts="False" OnDrillthrough="reportViewer_Drillthrough"
Font-Names="Arial" BackColor="#CED8EE" BorderStyle="None" Font-Size="10pt"
InternalBorderWidth="0px" ShowFindControls="False">
</rsweb:ReportViewer>