private void Page_Load(object sender, System.EventArgs e)
{
rptCustExHTML rpt = new rptCustExHTML();
try
{
rpt.Run(false);
}
catch (Exception eRunReport)
{
// Failure running report, just report the error to the user:
Response.Clear();
Response.Write("<h1>Error running report:</h1>");
Response.Write(eRunReport.ToString());
return;
}
// Buffer this page's output until the report output is ready.
Response.Buffer = true;
// Clear any part of this page that might have already been buffered for output.
Response.ClearContent();
// Clear any headers that might have already been buffered (such as the content type for an HTML page)
Response.ClearHeaders();
// Tell the browser and the "network" that this resulting data of this page should be be cached since this
// could be a dynamic report that changes upon each request.
Response.Cache.SetCacheability(HttpCacheability.NoCache);
// Tell the browser this is an Html document so it will use an appropriate viewer.
Response.ContentType = "text/html";
// Create the HTML export object
GrapeCity.ActiveReports.Export.Html.Section.HtmlExport html = new GrapeCity.ActiveReports.Export.Html.Section.HtmlExport();
// Export the report to HTML in this session's webcache:
//this.htmlExport1.Export(rpt.Document, GrapeCity.ActiveReports.Web
MyCustomHtmlOutputter outputter = new MyCustomHtmlOutputter(this.Context);
this.htmlExport1.Export(rpt.Document, outputter, "");
Response.Redirect("ReportOutput" + "/" + System.IO.Path.GetFileName(outputter.mainPage));
}