The steps to be followed to create and use Crystal Report


    Broad steps to create and link the crystal Report

  • Create or use an existing Windows
  • Add a Crystal Report object linking to a database
  • Add a Crystal Report Viewer control to the form and link its ReportSource property to the Crystal Report object created in Second step.
Detailed Steps to be followed:
  1. Create a new Windows application or you can use an existing windows application.
  2. Add new item from the Project option you will get the menu as shown in Fig. 1.
  3. From this select Crystal Report and then you can change the reports file name as you wish (example StudentReport) or you can accept the default CrystalReport1.rpt and then click on to Add.

  4. Now you will get Crystal Report Gallery screen as shown in Fig. 2. It provides three options Using the Report Wizard, As a Blank Report or From an Existing Report. Now select the default i.e. Using the Report Wizard and click on to OK button. So the report file is added to the project. Now you will get a Standard Report Wizard screen and here you can select a data source which is shown in Fig. 3.


  5. Now expand Create New Connection and you will get a screen as shown in Fig 4. Let us use OLE DB to get linked to the database. So click on to OLE DB (ADO) tree item. Now you will get a screen as shown in Fig. 5.


  6. Now select Microsoft OLE DB Provider for SQL Server as shown in Fig. 6 and click on to Next and you will get a screen as shown in Fig. 7. You check on the Integrated Security check box.


  7. Type the name of the server and select the database which is shown in Fig. 7 Here Server name is user and the database selected is BCA.
  8. Click on to Next and you will get screen as shown in Fig. 8. Now Click on to Finish, you will get a screen as shown in Fig. 9. This adds the BCA database to the list. Expand the database item, you can see the database tables (Fig. 10)



  9. Expand the Tables node and select the BCAMarks table and click on to the Insert tab then select the BCAStdInfo table and click on to Insert Tab, now both the tables are selected as shown in Fig.11.

  10. Now click on to next which moves automatically to the Links tab to indicate the connection between the two tables as shown in Fig. 12.

  11. Now select the fields of the tables you want to be displayed in the Report which is shown in Fig 13.

  12. Fig 14 shows the Existing Project to which you have added the crystal report.

  13. Now add the Crystal Report Viewer Control. Be in the FormDesign tab and from Tool box go to Crystal Report and add Crystal Report Viewer (Fig. 15) control to it which is shown in Fig. 16.


  14. Now attach the Report (CrystalReport1.rpt) to just added Crystal Report Viewer control. By doing this you can display the report in the Report Viewer, you must bind a report object to the viewer. This can be done by assigning the ReportSource property of the Windows Forms Viewer which is shown in Fig. 17.

  15. Now Run the Project you can see the Report as shown in Fig. 18.


Example << Previous

Next>>Selection Formula

Our aim is to provide information to the knowledge


comments powered by Disqus






Footer1