VB.NET Crystal Reports Export to PDF
When exporting from Crystal Reports to the PDF format, we utilize the CrExportOptions class provided by Crystal Reports. Additionally, we need to configure the PdfRtfWordFormatOptions and set the ExportFormatType to PortableDocFormat. The following example demonstrates the process of exporting a Crystal Report as a PDF file.
Before investigating into the Crystal Reports programming samples provided in this tutorial, it is recommended to familiarize yourself with the database structure that serves as the foundation for these examples. The database used in these tutorials is referred to as "crystaldb." To ensure a comprehensive understanding of the programming samples, we encourage you to review the database structure beforehand. You can access the database structure by clicking on the provided link: "Click here to see Database Structure." By acquainting yourself with the database structure, you will be better equipped to follow along with the tutorial and comprehend the various programming concepts demonstrated. - Click here to see Database Structure .
In this tutorial, we will be utilizing a previously developed program that provides a step-by-step guide on creating Crystal Reports to extract data from a database and present it in the reports. Prior to commencing this section, it is advisable to review the comprehensive step by step Crystal Report guide in VB.NET.
By referring to the step by step Crystal Report tutorial, you will gain a solid understanding of the systematic process involved in retrieving data from a database and effectively showcasing it using Crystal Reports. Familiarizing yourself with the concepts covered in the earlier Crystal Report program will significantly enhance your ability to grasp and implement the concepts discussed in the subsequent sections of this tutorial.
In the step-by-step Crystal Report guide, we learned how to retrieve all data from the Product table. In this section, we will focus on exporting that retrieved data to a PDF format file.
Select the default form (Form1.vb) you created in VB.NET and drag two buttons (Button1, Button2 ) and CrystalReportViewer control to your form.
Select Form's source code view and import the following :
Put the following source code in the button click events
Full Source VB.NET- Sample Database and tables for Crystal Reports tutorials
- Step by Step help for creating a simple Crystal Reports in VB.NET
- VB.NET Crystal Reports from multiple tables
- VB.NET Crystal Reports String parameter
- VB.NET Crystal Reports Integer parameter
- VB.NET Crystal Reports Date parameter
- VB.NET Crystal Report Load Dynamically
- VB.NET Crystal Reports Formula Fields
- VB.NET Crystal Reports Summary Fields
- VB.NET Crystal Reports Export to Excel
- Email a Crystal Reports from VB.NET
- Crystal Reports Without Database
- Crystal Report from SQL Query String
- Dynamic Crystal Reports from SQL Query String
- Crystal Reports from XML File
- Create a Subreport in Crystal Reports
- Create a Subreport in Crystal Reports with Link
- How to deploy Crystal Reports on Clinet Machine
- How to create Crystal Reports installer using Merge Modules