Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi every one, I am working on a project where I am using RDLC report, I want to use a master report for header and footer that contains some company informations and it binds with diffrent dataset and inside the main body of the report i have a subreport to show reports contents, this subreport is filled with diffrent datasets for diffrent reports. Everything is working fine but when there are more records in the subreport then it divides into pagging and when i click on the next page then its not working and show the first page again. Infacat i have missed a technique but i am unable to identify it.
Any help would be greatly appriciated.
My code to bind the reports is below:
C#
private void LoadReport()
    {
        var objAccess = new DataAccess();
        _dataSet = objAccess.CompanyGetAll();

        var mainReport = new StreamReader(Server.MapPath("~/Reports/ComanyInfo.rdlc"));
        ReportViewerTraineePayments.LocalReport.LoadReportDefinition(mainReport);
        ReportViewerTraineePayments.LocalReport.DataSources.Clear();
        ReportViewerTraineePayments.LocalReport.DataSources.Add(new ReportDataSource("DS_CompanyInfo",
                                                                                     _dataSet.Tables[0]));

        var subReport = new StreamReader(Server.MapPath(DynamicReportName));
        ReportViewerTraineePayments.LocalReport.SubreportProcessing +=
            new SubreportProcessingEventHandler(localReport_SubreportProcessing);
        ReportViewerTraineePayments.LocalReport.LoadSubreportDefinition("Rpt_Content", subReport);
    }

    private void localReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
    {
        e.DataSources.Add(new ReportDataSource(DynamicDataSetName, DynamicReportDataSource.Tables[0]));
    }

Thanks in advance.
Posted
Updated 11-Oct-13 18:48pm
v2

1 solution

Hey Tanweer,

Try setting AsyncRendering="true"
and make sure you have done:
C#
if(!IsPostBack){}
on your page load.

Let me know if it helps.

Cheers

Azee...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900