none
ReportViewer: complex report, extremely slow page navigation RRS feed

  • Question

  • Hello everyone.

     

    I have to generate a multiple page report that has a number of data sources included.


    I create the report at runtime by reading multiple .rdlc files and combining them into a single report definition in form of a MemoryStream. The MemoryStream and the DataSources are then passed to the ReportViewer control to display the report.

     

    My problem is that the navigation between pages takes way too long, upto around 5 sec. per page. Initially the ReportViewer is displayed in about 5-10 sec, which is acceptable, but then navigation to any page takes about 5 seconds.

     

    The report I'm currently testing is 55 pages and the .rdlc file contains around 65,000 lines.

     

    Are there any hints on the way I could increase the performance or is it limited by report definition size, number of datasources etc.?

     

    Thank you for any input.

     

    This is how I display the report:

    Code Block

    this.reportViewer.LocalReport.LoadReportDefinition(_presenter.ReportStream);

    this.reportViewer.ProcessingMode = ProcessingMode.Local;

    this.reportViewer.LocalReport.DataSources.Clear();

     

    ReportDataSource dummy = new ReportDataSource();

    dummy.Name = "CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent";

    dummy.Value = new List<RTRaisedRatesComponent>();

    this.reportViewer.LocalReport.DataSources.Add(dummy);

     

    foreach (ReportInfo reportInfo in _presenter.CurrentReportInfo)

    {

    foreach (KeyValuePair<string, object> kvp in reportInfo.DataSourceCollection)

    {

    this.reportViewer.LocalReport.DataSources.Add(kvp.Value as ReportDataSource);

    }

    }

    this.reportViewer.LocalReport.SetParameters(_presenter.ReportParameters);

    this.reportViewer.RefreshReport();

     

     

    This is the sample structure of the .rdlc file:

     

    Code Block

    <?xml version="1.0" encoding="utf-8"?>
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
     <DataSources>
      <DataSource Name="DummyDataSource">
       <ConnectionProperties>
        <ConnectString />
        <DataProvider>SQL</DataProvider>
       </ConnectionProperties>
       <rd:DataSourceID>70ae0586-4069-4c19-9209-5f1bcd68c796</rd:DataSourceID>
      </DataSource>
     </DataSources>
     <PageWidth>29.7cm</PageWidth>
     <ReportParameters>
      ...
     </ReportParameters>
     <Body>
      <ColumnSpacing>0.01cm</ColumnSpacing>
      <ReportItems>
       <Table Name="tableRO_0" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition">
        <Footer></Footer>
        <DataSetName>CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent_RatingOptionSummary_0</DataSetName>
        ...
        <Details></Details>
        <Header></Header>
        <TableColumns>
       </Table>
       <Table Name="tableRI_1" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition">
        <Footer></Footer>
        <DataSetName>CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent_RatingItemSummary_1</DataSetName>
        ...
        <Details></Details>
        <Header></Header>
        <TableColumns>
       </Table>
       <Table Name="tableRON_2" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition">
        <Footer></Footer>
        <DataSetName>CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent_RatingOptionSummaryNonRated_2  </DataSetName>
        ...
        <Details></Details>
        <Header></Header>
        <TableColumns>
       </Table>
       
       ...

       <Table Name="tableRIN_3" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition">
        <Footer></Footer>
        <DataSetName>CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent_RatingOptionSummaryNonRated_2   </DataSetName>
        ...
        
        <Details></Details>
        <Header></Header>
        <TableColumns>
       </Table>

      </ReportItems>
      <Height>0cm</Height>
     </Body>
     <PageHeader>
      <ReportItems>
       <Textbox Name="textbox46">
       </Textbox>
       <Textbox Name="textbox45">
       </Textbox>
       <Textbox Name="textbox44">
       </Textbox>
      </ReportItems>
      <Height>0.63492cm</Height>
      <PrintOnLastPage>true</PrintOnLastPage>
      <PrintOnFirstPage>true</PrintOnFirstPage>
     </PageHeader>
     <rd:ReportID>bc443919-f290-4783-870d-633db727ba50</rd:ReportID>
     <LeftMargin>1cm</LeftMargin>
     <DataSets>
      <DataSet Name="CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent_NotionalYieldSummary_5">
       ...
      </DataSet>
      <DataSet Name="CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent_RatingClass_6">
       ...
      </DataSet>
      <DataSet Name="CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent_RatingClass_7">
       ...
      </DataSet>
      ...
      <DataSet Name="CouncilManager_Infrastructure_Common_BusinessEntities_RTRaisedRatesComponent_Locality_46">
       ...
      </DataSet>
      
      ...
      
     </DataSets>
     <Width>27.75cm</Width>
     <InteractiveHeight>29.7cm</InteractiveHeight>
     <Language>en-US</Language>
     <TopMargin>1cm</TopMargin>
     <PageHeight>21cm</PageHeight>
    </Report>

     

     

     

    Monday, October 15, 2007 12:40 AM

All replies

  • Did you ever figure this out? I have a report that is neither big nor complex and it still is extremely slow, especially when trying to use print, page setup, or print layout.  Any idea why?


    Dave


     

    Wednesday, January 28, 2009 2:09 AM
  • Hi Evgeny,

    The local report viewer does not have the performance optimizations of the full server based report viewer using Server mode. Working with multiple datasets and large datasets can be time consumming because of synchronous operations.

    My recommendation would be to limit the amount of data passed to the report control to minimize the processing and formatting that the control performs before rendering.


    Brad Syputa, Microsoft Reporting Services This posting is provided "AS IS" with no warranties.
    Friday, January 30, 2009 5:43 PM