Skip to main content

Creating and Outputting Reports

Version: 6.0

Creating and Outputting Reports

Creating the resultant PDF from the DPLX file and then outputting that PDF is accomplished in three steps. First, instantiate the DocumentLayout using the DPLX file that was created. Secondly, call the DocumentLayout's Run method which creates the Document object. If nothing else needs to be added to or modified on the Document object it can then be output (either saved to disk, output to a System.IO.Stream object or output directly to IIS's output stream). For more information on using a DPLX file see Using a DPLX file or see Using a DPLX file from a Web Form for more on associating a DPLX file with a Web Form.

The following snippet of code demonstrates how to trigger the creation of the document as well as outputting that document to a location on disk:

DocumentLayout reportDocument = new DocumentLayout( @"Filepath/ReportLayoutName.dplx" );
Document document = reportDocument.Run();
document.Draw( @"C:\Temp\report.pdf" );
Dim reportDocument As DocumentLayout = New DocumentLayout("Filepath/ReportLayoutName.dplx")
Dim MyDocument As Document = reportDocument.Run()
MyDocument.Draw("C:\Temp\report.pdf")