RDLC报告中子报告的问题 [英] Pagging issue with subreport in RDLC report
问题描述
大家好,我正在开发一个项目,我正在使用 RDLC
报告,我想使用包含一些公司信息的页眉和页脚的主报告它与不同的数据集绑定,并在报告的主体内部有一个子报告
来显示报告内容,这个子报告用不同的数据集填充不同的报告。一切都运行正常但是当子报告
中有更多记录时,它会分为pagging,当我点击下一页然后它不工作并再次显示第一页时。 Infacat我错过了一项技术,但我无法识别它。
任何帮助都会非常适合。
我绑定报告的代码如下:
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.
推荐答案
Hey Tanweer,
尝试设置AsyncRendering =true
并确保你已完成:
Hey Tanweer,
Try settingAsyncRendering="true"
and make sure you have done:
if(!IsPostBack){}
在您的页面加载。
让我知道它是否有帮助。
干杯
Azee ......
on your page load.
Let me know if it helps.
Cheers
Azee...
这篇关于RDLC报告中子报告的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!