Experience in using Crystal Reports 4-using views to solve the problem of multi-Table Association in reports

Source: Internet
Author: User

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 :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.