How to Create Crystal Report using Visual Studio 2012 Part 1

How to Create Crystal Report using Visual Studio


This tutorial will focus on creation of Crystal Report using Visual Studio 2012.
 To accomplish this you will require to have:
  1. Microsoft Visual Studio 2012.
  2. MySQL.
  3. SAP Crystal Reports version for visual studio 2012. 
For the purpose of this tutorial, we will be using VB.Net.
 To start create a vb.net project
  1. Open visual studio (2012) and create a new project.
 
Creating a new project


 2. Select VB.NET then click on Windows Forms Application.
 Give it a name as shown in item 3 in the screenshot below. 
  Finally click OK.

 Now your project is set. You can now start the process of integrating it with Crystal Reports.

3.Right click on the name of your project.
 Click Add and then New Item.



4. Add New Item dialog box will appear. Under Common items select Data tehn select Dataset.
 Give it a name and click Add as shown below.


Selecting Dataset
5. A Dataset Designer comes up. 
Right-click on it and select Add then Click on TableAdapter.
Dataset Designer
6. A TableAdapter configuration wizard comes up. 
TableAdapter Configuration Wizard
7. If you had not set the connection, it's time to do so. Click the New Connection button.  In the Change Data Source dialog box that will appear, select Microsoft ODBC Data Source and click OK.
Selecting Data Source
A new dialog box will pop up. This is the Add Connection dialog box. Under Data source, it's already indicated the datasource that you selected above. If you wish to change, click the Change... button and select a corresponding datasource. Under Data source specification, select Mysql. Proceed and key in your login information; this being the username and password you use to login to yous Mysql database. Click the Test Connection button to see whether the detais you provided are collect; if they are, you will get a message stating that the connection is successful. Click OK.
Adding connection
8. Choose a command type and click Next. Here you declare whether your TableAdapter will use SQL statement or a stored procedure. In our case, our TableAdapter will use an SQL statement. So we select the Use SQL statement option and then we click Next.


Choosing command type
9. Next enter SQL statement or alternatively use the Query Builder to build your desired query. We take the second option.


10. Select tables to be used and click Add.

Add Table

11. Select fields that will appear in the dataset. Do so by ticking the square to the left of each field name. Click OK and then click Next.
Fields selection

12.  The TableAdapter Configuration Wizard appears. The purpose of the TableAdapter methods is to load and save data between your application and the database. Choose methods to generate e.g. Fill and click Next. Finally click FINISH.
TableAdapter Configuration Wizard

So far so good. It's time to create a report.

Proceed to the next part by following the link below:





Create A New Report

Comments

Popular posts from this blog

How to paste image into picturebox from clipboard with VB.Net

CREATING CRYSTAL REPORTS VB.NET 2012 STEP BY STEP - PART 2