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:
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.