This is a migrated thread and some comments may be shown as answers.

Report parameters huge data issue

1 Answer 200 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kishore
Top achievements
Rank 1
Kishore asked on 22 Nov 2011, 02:38 PM
I am getting WCF service exception when I am trying to add huge data to report parameter, if we send small chunk of data its working fine. do verify my code and suggest me the right way to add parameter data. Added web.config setting along with the reportviewer code.
<bindings>
      <customBinding>
        <binding name="BinaryHttpBinding">
          <binaryMessageEncoding>
            <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
              maxBytesPerRead="2147483647" maxNameTableCharCount="16384" />
          </binaryMessageEncoding>
          <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
      </customBinding>
</bindings>

public partial class ReportViewer : Page, IReportServiceClientFactory
   {
       public ReportSettingsDTO ReportParametersObject { get; set; }
       public ReportViewer()
       {
           InitializeComponent();
           this.rptViewer.ReportServiceClientFactory = this;
           this.rptViewer.Report = "WebClient.Reports.TestReport, WebClient";
           this.rptViewer.RenderBegin += new RenderBeginEventHandler(rptViewer_RenderBegin);
       }
 
       void rptViewer_RenderBegin(object sender, RenderBeginEventArgs args)
       {
           args.ParameterValues["ParameterObject"] = serialize();
       }
       public string serialize()
       {
           MemoryStream ms = new MemoryStream();
 
           // Serializer the User object to the stream.
           DataContractSerializer ser = new DataContractSerializer(typeof(ReportSettingsDTO));
           ser.WriteObject(ms, ReportParametersObject);
           byte[] array = ms.ToArray();
           ms.Close();
           return Encoding.UTF8.GetString(array, 0, array.Length);
       }
 
       #region IReportServiceClientFactory Members
 
       ReportServiceClient IReportServiceClientFactory.Create(System.Uri remoteAddress)
       {
           var binding = new BasicHttpBinding()
           {
               TransferMode = System.ServiceModel.TransferMode.Buffered,
               MaxBufferSize = int.MaxValue,
               MaxReceivedMessageSize = int.MaxValue,
               OpenTimeout = new TimeSpan(0, 15, 0),
               ReceiveTimeout = new TimeSpan(0, 15, 0),
               SendTimeout = new TimeSpan(0, 15, 0)
           };
 
           var endpointAddress = new EndpointAddress(remoteAddress);
 
           return new ReportServiceClient(binding, endpointAddress);
       }
 
 
       #endregion
   }

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 25 Nov 2011, 01:44 PM
Hello Kishore,

The Report Parameters are send to the service with GET request. Its maximum length depends on the browser you use and you're most likely exceeding the allowed number of characters. Anyway the Report Parameters are not meant to be used for what you do - sending your data to the report engine. The major usages of the report parameters are:
  • to vary report data retrieved from a Data Source component
  • in expressions to directly provide a value
  • in data item filtering, sorting or grouping criteria

As the reports reside on the server, the correct approach would be to use the NeedDataSource event where you generate your data query and based on a parameter value, change that query accordingly.

Regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Kishore
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or