I have been busy with the development of the production plan management system recently, so I rarely leave a message here. Please forgive me! Fortunately, the project has entered the final stage of the test. As the project uses the Crystal Report for report processing, many friends have left a message about the problems they encountered during the development of the crystal report, so this time I wrote some tips for using Crystal Reports for your reference (this is purely personal experience. please correct me if you are not interested ).
In fact, in my previous three posts, I basically talked about how to solve the problems encountered by using the crystal report. I will not repeat it here. You can refer to my previous post. Here we will focus on using views to solve the problem of multi-Table Association in reports.
Multiple Fields in multiple tables are often used in reports. Association in the rpt file will be annoying and you will be confused at the end. We recommend that you create a view in the database, which saves a lot of trouble and is not prone to errors.
1. Create a view in the database.
2. Drag the view into the dataset File View. XSD to generate a dataset.
3. Create an rpt file and select the newly created dataset from the ADO. NET data source.
4. Create a. aspx file and drag the report control.
5. Declare and instantiate the dataset created in step 1 in. aspx. cs. View v = New View ();
The SQL statement is used here, but it is also very simple. You can copy the SQL statement in the view. If you want to add a filter, add the filter condition;
Then fill V with the data sqldataadapter1.fill (v, "view name ");
Finally, bind V to the rpt file.
This is basically the case. If you have any questions, please leave a message :)