C# AspxDocumentViewer XtraReport和空数据

C# AspxDocumentViewer XtraReport和空数据,c#,devexpress,xtrareport,C#,Devexpress,Xtrareport,我正在使用XtraReport和AspxDocumentViewer。我写这些代码是为了显示。但我总是遇到一些问题;空数据 如何解决这个问题?我看不出有什么问题 顺便说一下“dsMast”,它是数据集,共有十行。但报告仍然是空的 string fpth = Server.MapPath("."); fpth = fpth + "\\report\\rprFtrLst22222.repx"; XtraReport report = XtraReport.FromFile(fpth, true);

我正在使用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;
我解决了我的问题。 首先,我为页面加载添加了一些代码

        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;

调试代码时会发生什么。。?如果要输入到快速查看中,您是否看到任何数据以下
dsmaster.Tables[0]
尝试将数据源设置为该数据源,并查看其是否有效,或者查看数据集或数据表是否具有LoadFromFile方法并将报告传递到数据集。表[0]。LoadFrom…etcI更改的数据源,共有十行。但问题是一样的。到这里看看他们的文档