Crystal Reports from SQL Query String
We can create Crystal Reports in VB.NET using SQL Query String . Here we create a Strongly Typed dataset for Crystal Reports design and create a connection object and execute the SQL Query String .
All Crystal Report programming samples in this tutorials is based on the following database (crystaldb) . Please take a look at the database structure before you start this tutorial - Click here to see Database Structure .
The basics of Crystal Reports creation you can find in the previous section of this tutorial , before we start this tutorial you can take a look at the step by step Crystal Report.
Generating a Strongly Typed DataSet
In the previous section you can see a detailed tutorial about to create a strongly typed datset and its Crystal Reports design . After create the dataset and Crystal Reports design you should create a connection object and fetch the data from database.
Select the default form (Form1.vb) you created in VB.NET and drag one button and CrystalReportViewer control to your form.
Put the following source code in the button click events
You have to provide the necessary databse information to Connection String.