ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

17-Generating 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 Employee’s Information in Visual Studio 2008. Add a new Windows Form Application. And hit add.

crystalreportEmp(3)_form1

After that, add the Crystal Reports Viewer and Report Documents in the reports Form.

crystalreportEmp(3)_form2

Go back to the Design Views and click the Form1. Add a Button, name it “Print”.

 

crystalreportEmp(3)_form3

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. frmreports.Show()
  4. 'getting the crystal report and placing it on the crystal report viewer using the report documents that represent as a EmpInfo.rpt
  5. frmreports.CrystalReportViewer1.ReportSource = reports.EmpInfo.rpt
  6. End Sub
Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!