0

私は RDLC レポートを使用しているプロジェクトに取り組んでいます。いくつかの会社情報を含むヘッダーとフッターにマスター レポートを使用したいのですが、それは異なるデータセットとバインドされ、レポートの本体内にレポートを表示するサブレポートがあります。このサブレポートには、さまざまなレポートのさまざまなデータセットが含まれています。

すべてが正常に機能していますが、サブレポートにさらにレコードがある場合、ページングに分割され、次のページをクリックすると機能せず、最初のページが再度表示されます。

Infacat テクニックを見逃しましたが、特定できません。

レポートをバインドする私のコードは次のとおりです。

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]));
}
4

1 に答える 1

0

AsyncRendering="True" 設定して自分でやった

protected void Page_Load(オブジェクト送信者, EventArgs e) { if (!IsPostBack) { LoadReport(); } }

于 2013-10-12T05:12:32.523 に答える