AspxDocumentViewer XtraReport 和空数据

AspxDocumentViewer XtraReport and empty data

我正在使用 XtraReport 和 AspxDocumentViewer。我写了那些代码来展示。但我总是遇到一些问题;空数据。

如何解决这个问题?我看不出有什么问题。

顺便提一下"dsMast",它是数据集,有十行。但是报告仍然是空的。

string fpth = Server.MapPath(".");
fpth = fpth + "\report\rprFtrLst22222.repx";
XtraReport report = XtraReport.FromFile(fpth, true);
report.DataSource = dsMast;
report.LoadLayout(fpth);
report.CreateDocument();
string reportName = (string)"report";
ASPxDocumentViewer1.Report = report;
ASPxDocumentViewer1.DataBind();
Session["ReportName"] = reportName;

我解决了我的问题。 首先,我为 page_load

添加了一些代码
        if (Session["report2"] != null)
        {
            ASPxDocumentViewer1.Report = Session["report2"] as XtraReport;
        }

然后我使用了thoso代码。

        report.DataSource = dsMast;
        report.LoadLayout(fpth);
        report.CreateDocument();
        ASPxDocumentViewer1.Report = report;
        ASPxDocumentViewer1.DataBind();
        Session["report2"] = report;