Crystal Reports from XML File
In this section, we will explore the process of creating Crystal Reports using an XML file instead of a traditional database as the data source. The methodology for creating Crystal Reports from an XML file is quite similar to that of creating reports from a database. The key distinction lies in selecting the data source as your XML file.
To begin, we will create an XML file named "Product," which mirrors the structure of the Product table found in the sample Database Structure. This XML file will serve as the data source for our Crystal Reports.
Before proceeding with this section, it is assumed that you have a basic understanding of Crystal Reports creation. However, if you are new to Crystal Reports or require a refresher, I recommend referring to the step by step Crystal Report tutorial provided earlier in the tutorials. This tutorial offers a comprehensive guide on creating Crystal Reports, ensuring you have the necessary knowledge to proceed with this section.
The key change in this section lies in the selection of data for your Crystal Report. Instead of choosing a traditional database as the data source, you will opt for a different approach. When selecting the data for your Crystal Report, you will navigate to the "Create New Connection" option and choose "Database Files." From there, you will select the XML file you wish to use for generating the Crystal Reports, specifically the "Product.xml" file in this case.
Select all the fields from Product and click finish button
Now the designer part is over . Next step is to select the default form(Form1.vb) and add a Button and Crystal Reports Viewer to the Form.
Put the following vb.net source code in your form and run the program .
Full Source VB.NETcryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
The Crystal Report is in your project location, there you can see CrystalReport1.rpt . So give the full path name of report here.
- 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 PDF
- 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
- 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