Quantcast
Channel: SQL Server Reporting Services
Viewing all articles
Browse latest Browse all 1418

How to catch reportviewer's time-out error message?

$
0
0

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>


Viewing all articles
Browse latest Browse all 1418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>