Rdlc drilling report drillthrough report

Source: Internet
Author: User
The data source for the rdlc drill-through report drillthrough Report2010-10-09 drill-through report should be two tables with primary-subrelationships, in which order and order details in the northwind database are used as the data source.

1. Create a Windows application rdlcdr in Visual Studio 2005.

2. Add a data source to a project. The data source is not necessarily used to provide data for reports (of course, Visual Studio
2005 provides very convenient operations), mainly in the report design, you can easily drag fields to the report. Adding a data source means that a dataset orders. XSD file is added to the project,
When the report data is not from a relational database (such as flat files or web
Services), we can define an XSD file as the data source for report design, and reload data for the report in the program.

3. Add the report rptorder. rdlc to the project. This report is very simple and does not detail the design steps. The "order" content is displayed in the report file. Its structure is shown in 1:


Figure 1 Structure of the "order" report

4. Add Report rptorderdetails. rdlc as shown in figure 2:


Figure 2 Structure of the "Order details" report


5. In the report rptorder. rdlc, select the first column "= fields!" in the "table details" row of the table control! Order ID. Value "cell, right-click" attribute "to pop up" Text
In the Properties dialog box (3), on the "hyperlink operation" tab of the "navigation", select "Jump to report", select report rptorderdetails from the drop-down list, and click
Click the "parameter..." button on the right of the List to set it as shown in Figure 4.


Figure 3 "text box properties" dialog box


Figure 4 "Jump to report" parameter settings

6. In report rptorderdetails, choose Report> report parameters to enter the report parameters dialog box, and set the orderid parameter, as shown in Figure 5, this parameter is mainly used to receive and transmit values from rptorder.


Figure 5 set the orderid of the report parameter (click the thumbnail to view the large image)


7. Select the table control in the report rptorderdetail, right-click "properties", and enter the "Table properties" dialog box. On the "filter" tab, set the filter shown in 6. In construction
When using a filter, it is best to use the "Edit expression" dialog box to generate an expression. Unless you are familiar with it, the handwritten expression may be incorrect. For example, there must be "=" before the expression ".


Figure 6 filter settings

OK. Now, the content to be done in the report design is complete. The following describes how to provide data for the report and display it in reportviewer.

8. Place the reportviewer control on the winform, and click the triangle symbol in the upper-right corner of the control.
In the task dialog box (figure 7), select report rdlcdr. rptorder. rdlc. If the preceding dataset file (. XSD file) is automatically generated by the system
Create a dataadapter, bindingsource, and dataset for the form, and delete the data source. Manually specify the report data source in the following steps. Otherwise, a report may appear.
No error is reported for the table, but there is no data in the report.


Figure 7 reportviewer task dialog box

9. Use the code shown in 8 in the form to specify the data source for the report and drill-down report to complete the final operation. Note that the "dataset name" in "8" must be specified correctly, and this name can be obtained from the dialog box shown in "9.


Figure 8 code of the specified data source (click the thumbnail to view the big image)


Figure 9 source of "dataset name"

The result is as follows:


Figure 10 "order" report


Figure 11 "Order details" drilling report

Download demo

In addition, you can use this method to create a drillthrough report in a web application. However, in the Code, Microsoft. Reporting. winforms. reportdatasource should be changed to Microsoft. Reporting. webforms. reportdatasource.

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.