Crystal reports for visual studio 2010 .We have seen and worked with crystal reports in visual studio 2008 and 2005, both versions have their own crystal reports, the developer’s use them for creating reports without any trouble. But in the version of visual studio 2010 there is no any crystal report you have to install it separately from SAP websites. When I was working on visual studio 2010 first time, I have faced lots of problems in creating reports, finally I did it and going to share my experiences with my visitors and those developers who are struggling to create reports using visual studio 2010. After adding pages and creating databases to your project you have to install crystal report first. Without installing crystal reports you will be unable to generate reports. So download crystal report first from SAP website, please follow this link to download crystal report.
Download Crystal reports for visual studio 2010
Step-1: Creating Datasets
The initial and first step of creating reports is creating dataset. First of all we will make datasets which will be used in creating reports. To add a DataSet file, click on Solution Explorer >> right click on the project folder >> click on Add New Item and then click on Dataset. Enter the name to dataset file and click on ok. You can use the default name also, we have named “projectdatase” to the dataset file. Here is a screen shot below:
When you will click on Add button you will see an alert box asking for confirmation to save dataset in the App_Code folder, just click on Yes, you dataset will be placed on App_Code folder and there will show a blank screen as shown below.
Now in this screen we will add tables from the database which we are going to use in reporting. There are many ways to add tables from the database, here we will use simple and easy technique to add tables. Open your database >> go to tables >> select your tables that you want to display or creating reports, drag them and put into the blank screen. Here is a screen shot:
After dragging save your dataset file. Your data set has been successfully created. Now we will create a crystal report design.
Step-2: Designing crystal report
· The designing phase of crystal report is very simple and easy hopefully you will do this easily without any trouble. Once again open solution explorer from your project folder >> right click on the project name and select crystal report and name it according to your requirements, as we have named to data set when we were creating just repeat that process. Here is the screen shot below:
After named crystal report when you will click on Add button it will show a new window asking for some report creation type, just use the default settings and click on ADD.
After named crystal report when you will click on Add button it will show a new window asking for some report creation type, just use the default settings and click on OK.
After clicking on OK the process will continue with the next step. In this step we will select the dataset which we have been created earlier in the start of this article.
In the new windows you will see any available data source you have to select your required data source. So Select Create New Connection >> Go to ADO.NET (XML). When you will click on ADO.Net a new window will be opened here you have to select your desired path. Click on the icon >> select your data set path from App_Code folder >> click open and then click on Finish. As shown below:
When you will click on finish button you will see your table has been successfully added. Select your table and click on Next.
In the next step you will choose the information from your table that you want to display in the report. Select those fields and click On Next and then click on Finish.
Step-3: Adding crystal report viewer
Go to tool box Select Reporting >> Go to CystalReportViewer drag it into your page in which you want to display you information. After dragging choose Report source from Report source control, then click on OK, as you have created earlier. As shown below screen shot:
These are the steps of using crystal report in visual studio 2010. I have tried to discussed some methods here hopefully now you will be able to create crystal reports in visual studio 2010. It is very difficult to describe all the things in just one article here I have mentioned some main key points, hopefully will be helpful for yo