所以从保存的文件中加载一个报告(这似乎不是执行操作的一般方法),但报表查看器拒绝初始化参数弹出窗口。 WTF !!!
以下是代码:
protected void Page_Load(object sender, EventArgs e)
{
string ReportName = Request["ReportName"];
XtraReport newReport = CreateReportFromFile(ReportName);
newReport.RequestParameters = true;
ReportViewerControl1.Report = newReport;
}
private XtraReport CreateReportFromFile(string filePath)
{
XtraReport report = new XtraReport();
report = XtraReport.FromFile(filePath, true);
return report;
}
答案 0 :(得分:1)
仅在整页加载帮助时才这样做吗?
protected void Page_Load(object sender, EventArgs e)
{
if( IsPostBack || Is IsCallBack )
{
return
}
string ReportName = Request["ReportName"];
XtraReport newReport = CreateReportFromFile(ReportName);
newReport.RequestParameters = true;
ReportViewerControl1.Report = newReport;
}