views:

234

answers:

1

So were loading a a report from a saved file (this seems to not be the general way to do things), but the report viewer refuses to initialise the parameters popup. WTF!!!

Here's the code:

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;
}
+1  A: 

Does doing this only on a full page load help?

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;
}
kervin
Tx for the answer. still have to check if it'll work.
Jan de Jager