none
Unable to load report with many record, Error (400) Bad Request RRS feed

  • Question

  • Please help, any suggestion are highly welcomed. I have a webpage that has a report inside, it work fine when there is not many records, but when it have more than 400 records, it will have the following error:

    The remote server returned an error: (400) Bad Request.

    An error has occurred during report processing.
    Exception has been thrown by the target of an invocation.
    Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.


    my aspx page
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutputSummReport.aspx.cs" Inherits="WebSite.OutputReport" %>
    
    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
        Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
                Font-Size="8pt" ShowPrintButton ="False" Height="600px" Width="1100px">
                <LocalReport ReportPath="Output Summary Report.rdlc">
                    <DataSources>
                        <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 
                            Name="OutReportDataSet_GetOutRecordsForReport" />
                    </DataSources>
                </LocalReport>
            </rsweb:ReportViewer>
        
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" 
                
                TypeName="WebSite.OutReportDataSetTableAdapters.GetOutRecordsForReportTableAdapter">
                <SelectParameters>
                    <asp:Parameter Name="OrderList" Type="String" />
                    <asp:Parameter Name="OrgID" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
        
        </div>
        </form>
    </body>
    </html>
    

    the code behind
    using System;
    using System.Data;
    using System.Data.SqlClient;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Microsoft.Reporting.WebForms;
    
    namespace WebSite
    {
        public partial class OutputReport : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                ReportViewer1.Visible = true;
                string mqids = Session["SelectedMQID"].ToString();
                string id = Request.QueryString["orgid"];
                ObjectDataSource1.SelectParameters.RemoveAt(0);
                ObjectDataSource1.SelectParameters.RemoveAt(0);
                Parameter p1 = new Parameter("OrderList", System.Data.DbType.String, mqids.ToString());
                Parameter p2 = new Parameter("OrgID", System.Data.DbType.String, id.ToString());
                ObjectDataSource1.SelectParameters.Add(p1);
                ObjectDataSource1.SelectParameters.Add(p2);
                ReportViewer1.LocalReport.Refresh();
                Session["SelectedMQID"] = null;
            }
        }
    }
    
    Thursday, March 18, 2010 8:08 AM

All replies

  • You can try changing the connection timeout in the connection string for your data source. See this thread for more info: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/7af4cd2c-034a-4501-a062-8caaa2e6e924.

     


    Cephas Lin This posting is provided "AS IS" with no warranties.
    Thursday, July 22, 2010 4:07 PM
    Moderator
  • Hi..................

    Hey your problem is with the  Service Time out.

    Open your web.config file and increae receiveTimeout and sendTimeout. your problem may be solved.

    If still you face same problem then increase the size of maxArrayLength,maxReceivedMessageSize,maxBufferPoolSize.

    Example.

     <wsHttpBinding>
        <binding name="wsHttpBindingForLargeQuotas" closeTimeout="00:01:00" transactionFlow="true" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="20971520" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
         <readerQuotas maxDepth="64" maxStringContentLength="20971520" maxArrayLength="20971520" maxBytesPerRead="4096" maxNameTableCharCount="20971520"/>
         <security mode="Message">
          <transport clientCredentialType="None" proxyCredentialType="None"
            realm="" />
          <message clientCredentialType="Windows" negotiateServiceCredential="true"
            algorithmSuite="Default" />
         </security>
        </binding>
    Friday, July 30, 2010 11:25 AM