Exporting a Report Programmatically

Another useful feature is the ability to export a report document without the end user viewing it first and then clicking the Export button on the toolbar. To do this, you use the ExportOptions collection of the ReportDocument class to set properties on what you want to export and how it should be exported. The code in Listing 18.3 exports a report file to a PDF file and saves it to disk.

Listing 18.3. Exporting a Report with Code Using the Export Method
 Private Sub button1_Click(sender As Object, e As System.EventArgs) ' The path/location where the exported file will be saved Dim exportFilePath As String = ...

Get Sams Teach Yourself Visual Studio® .NET 2003 in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.