How do I return the page to 1 when viewing a new report?
Posted: Thu Jan 17, 2013 3:07 am
In my application I have a web page that lists the reports a user can view. If a user clicks on a report name it sends the user to ViewReport.aspx?ID=xxx, where xxx is the report ID that in my database contains information as to the report path (SalesInvoice.mrt, for example) and the data to load for that report. The ViewReport.aspx page uses the StiWebViewer web control to display the report using code like so:
Here reportViewer is the StiWebViewer web control.
The issue I'm having is that if a user opens one report and moves to page 3, say, when they go back to the report list and then open a new report it starts them on page 3 (rather than page 1).
How do I get it so that whenever the user opens a new page they are sent back to the first page?
I've tried the following:
But had no luck. Also tried this:
But no dice.
Thanks
Code: Select all
// Get the report file path
string reportFilePath = "..."; // depends on xxx
StiReport report = new StiReport();
report.Load(Server.MapPath(reportFilePath));
report.Dictionary.Variables.Add("ReportId", this.ReportId);
reportViewer.Report = report;
The issue I'm having is that if a user opens one report and moves to page 3, say, when they go back to the report list and then open a new report it starts them on page 3 (rather than page 1).
How do I get it so that whenever the user opens a new page they are sent back to the first page?
I've tried the following:
Code: Select all
reportViewer.ResetPageNumberOnAssignNewReport = true;
Code: Select all
report.PageNumber = 1;
Thanks