Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To create a crystal report from a dataset in VB.NET, follow the steps below:

  1. Create a new Windows Forms application in Visual Studio.
  2. Add a reference to the CrystalDecisions.CrystalReports.Engine and CrystalDecisions.Shared assemblies.
  3. Add a Crystal Report to your project.
  4. Create a dataset in your project that contains the data you want to display in the report.
  5. Drag and drop a Crystal Report Viewer control onto your form.
  6. In the form's Load event, add the following code:

    Dim report As New CrystalReport1() 'Replace CrystalReport1 with the name of your report report.SetDataSource(dataset1) 'Replace dataset1 with the name of your dataset CrystalReportViewer1.ReportSource = report

  7. Run the application to display the report in the Crystal Report Viewer control.

Note: You may need to configure the Crystal Report Viewer control to connect to your database if your dataset is based on a database.