After a report has been generated, a ReportDocument is returned. The report document can be used to produce Html, Excel and PDF. It can also be used to publish a snapshot of the report to a database. Published reports can then be later restored back to a ReportDocument for producing Html, Excel and PDF reports.
Example
This example shows how to create a ReportQuery, generate the report and return a PDF.
var query = ReportGallery.NewReportQuery(“InvoiceReport”);
var builder = new ReportBuilder();
var document = builder.BuildReport(query);
var pdfStream = document.ToPdf();
return new FileStreamResult(pdfStream, “application/pdf”);
Properties
ActivePageId | The Id of the page of the report that is currently being viewed in HTML. |
IncludeCoverPageInHtml | False by default, but if true, then the HTML list of pages will include the cover page. |
IsPublished | True if the ReportDocument was created using published data. |
ReportId | The Id of the report document, which is the same as the ReportQuery Id. |
ReportCode | The gallery code that this report document was based on. |
ReportTitle | The title of the report. |
CustomExcelStyles | The filename of the custom Excel styles file that will be used to control the style of Excel exports. By default this is CustomExcelStyles.xslt |
CustomHTMLStyles | The filename of the custom HTML styles file that will be used to control the style of HTML reports. By default this is CustomHTMLStyles.xsl |
CustomPDFStyles | The filename of the custom PDF styles file that will be used to control the style of PDF exports. By default this is CustomPDFStyles.xsl |
Methods
GetReportData | Returns the data used to create the report. This can be published as a snapshot so that the report can be re-created at a later time. |
Publish | Returns the report XML that can be stored in a database and used at a later time to re-create the ReportDocument. |
ToExcel | Creates and returns an Excel XML file as a Stream. |
ToHtml | Creates and returns an HtmlDocument, which includes the various parts of the report. |
ToPdf | Creates and returns a PDF file as a Stream using iBexPDF. |
Update | Updates the ReportDocument with a reportQuery json string. This allows a user to navigate to a limited extent around a published document. |
Click to see Comments