Creating a Report in Student Registration Using Crystal Reports Part 3

This is the continuation of my tutorial. This time I will show you how to put a Crystal Report in a Windows Form and retrieving the records from the database. Let’s begin: First, open the file of Student Registration in Visual Studio 2008. Add a new file which is a Windows Form. And hit add. Report Form Now, add the Crystal Reports Viewer and Report Documents in the reports Form. Add Report Go back to the Design Views and click the Form1. Add a Button named “Print all Student’s Records”. Print All Double click the button and do this following code for showing the reports.
  1. Private Sub report_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. 'showing the reports
  3. reports.Show()
  4. 'getting the crystal report and placing it on the crystal report viewer using the report documents that represent as a studentInfo.rpt
  5. reports.CrystalReportViewer1.ReportSource = reports.studentInfo1
  6. End Sub
This is the last part of my tutorial. You can download the source code and run it on your computer.

Add new comment