Part One
Good day, people. I have received quite a number of requests from some of my friends and colleagues to write about crystal report application development. So, I will begin my first technical post with – how to create a crystal report application.
There are many ways to build a crystal report application. However, I will emphasize on 2 methods which I personally prefer to use, which are:-
a) Using ODBC Data Source during Crystal Report design time.
b) Set database connection information for Crystal Report during runtime.
I am using Visual Studio 2005 with Crystal Report 9 as the development platform, and I will use Microsoft SQL Server Express Edition as the database.
Method (a): ODBC Data Source
1. First, we need to create a Data Source for the database. Go to Control Panel -> Administrative Tools -> Data Source (ODBC) or just type “odbcad32.exe” in the Run command dialog box to open it.
2. Go to System DSN tab. Add a new data source using SQL Server driver. Click Next.
3. Insert a name for the data source. I name it as SQLDS. Then enter the SQL Server name at the server field or select one from the drop down list. Click Next.
5. Check the “Change the default database to” option, and select the initial database for the connection. Click Finish.
6. A summary dialog box will prompt. Test the connection. If the connection failed, close the dialog and go back to the previous screen to check the settings. A data source named SQLDS is created successfully.
7. Create a new Crystal Report Application project, starting with a blank report.
8. In Visual Studio 2005, go to the Crystal Report menu -> Database -> Database Expert.
9. Create a new connection using ODBC. Select the data source you have just created – SQLDS from the list. Click Next.
10. Check the “Trusted Connection” option. Take note that you don’t have to enter any login information here. Click Finish.
Now, you can start selecting the tables you want to include in the report and design the report the way you like. So, you have successfully created a Crystal Report using an ODBC data source connection, which is still usable wherever you deploy the application to, without extra coding needed as long as you have created the ODBC data source correctly during the deployment of the application.
Here ends the Part One of creating a crystal report application. Stay tuned for Part Two : Method (b) - Set database connection information for Crystal Report during runtime.
Thank you.
Good day, people. I have received quite a number of requests from some of my friends and colleagues to write about crystal report application development. So, I will begin my first technical post with – how to create a crystal report application.
There are many ways to build a crystal report application. However, I will emphasize on 2 methods which I personally prefer to use, which are:-
a) Using ODBC Data Source during Crystal Report design time.
b) Set database connection information for Crystal Report during runtime.
I am using Visual Studio 2005 with Crystal Report 9 as the development platform, and I will use Microsoft SQL Server Express Edition as the database.
Method (a): ODBC Data Source
1. First, we need to create a Data Source for the database. Go to Control Panel -> Administrative Tools -> Data Source (ODBC) or just type “odbcad32.exe” in the Run command dialog box to open it.
2. Go to System DSN tab. Add a new data source using SQL Server driver. Click Next.
3. Insert a name for the data source. I name it as SQLDS. Then enter the SQL Server name at the server field or select one from the drop down list. Click Next.
- Take note that we are using SQL Express database. If you can’t find any server name with \SQLEXPRESS from the drop down list, key in <COMPUTER NAME>\SQLEXPRESS.
5. Check the “Change the default database to” option, and select the initial database for the connection. Click Finish.
6. A summary dialog box will prompt. Test the connection. If the connection failed, close the dialog and go back to the previous screen to check the settings. A data source named SQLDS is created successfully.
7. Create a new Crystal Report Application project, starting with a blank report.
8. In Visual Studio 2005, go to the Crystal Report menu -> Database -> Database Expert.
9. Create a new connection using ODBC. Select the data source you have just created – SQLDS from the list. Click Next.
10. Check the “Trusted Connection” option. Take note that you don’t have to enter any login information here. Click Finish.
Now, you can start selecting the tables you want to include in the report and design the report the way you like. So, you have successfully created a Crystal Report using an ODBC data source connection, which is still usable wherever you deploy the application to, without extra coding needed as long as you have created the ODBC data source correctly during the deployment of the application.
Here ends the Part One of creating a crystal report application. Stay tuned for Part Two : Method (b) - Set database connection information for Crystal Report during runtime.
Thank you.
March 25, 2009 at 7:40 AM
Finally, a first blog from Ben. Seems cool to me..keep it up ^^