Configure subreports and drill-down reports

Source: Internet
Author: User

You can use subreports and drill-down reports to link relevant reports.

  • A subreport is an item that is embedded into another report in the table of the parent report. In terms of concept, subreports are similar to the frameworks in web pages that provide containers for other web pages. The subreport is displayed in the parent report that contains the subreport. Both reports are processed and displayed.

  • A drilling report is a report created when you want to support drilling links to other related reports. Generally, a drilling report is associated with a parent report through data. An example of a common drilling report is a monthly sales report that contains links to each sales order in the current month. When you click the drilling link, the parent report is replaced by other reports that support detailed information.

Both Drilling Reports and subreports support the concept of parent and subreports. To associate these reports, you must create report parameters to pass the data used to establish the relationship. To link these reports at runtime, you must write code that supports this connection. When deploying related reports, make sure that the client report definition (. rdlc) files are stored in the same folder on the file system.

The following event provides sample code to illustrate how to implement subreports and drilling operations:

  • Drillthrough

  • Subreportprocessing

  • Drillthrough

  • Subreportprocessing

Add subreport

Subreports and their parent reports should be associated with the shared parameters. Parameters must be added for each report. You must configure these parameters before adding a subreport to the parent report. When adding a subreport, you must set the parent report to pass parameters to the subreport.

Add subreport
  1. In graphic design mode, open the client report definition (. rdlc) file.

  2. In the toolbox, click subreport ".

  3. On the Design surface, drag a box to adjust the size of the subreport as needed. Alternatively, you can click the design surface to create a fixed-size subreport.

    Note:

    If a sub-report already exists in the project, you can drag the report from Solution Explorer to the design drawing to create a sub-report.

     

  4. Right-click the subreport and then click "properties ".

  5. In "subreport", select the report that you want to display in the subreport area.

  6. On the parameters tab, perform the following operations:

    • In "parameter name", type the parameter name in the subreport. This name must match the name of the report parameter named in the reportname attribute.

    • In "parameter value", type the value to be passed to the subreport. This value can be static text or an expression pointing to a field or other object in the parent report.

  7. Repeat Step 2 to add other parameters to be passed to the subreport.

Note:

All parameters required by the subreport must be included in the "Parameters" list. If necessary parameters are missing, the subreport is not correctly displayed in the parent report.

 

To provide data for a subreport, the application must process the subreportprocessing event of the localreport object. Subreportprocessingeventargs is one of the parameters passed to the subreportprocessing event handler method. In the event handler, the application checks the parameter values passed to the subreport using the parameters attribute of subreportprocessingeventargs. Then, the application must use the CES attribute of subreportprocessingeventargs to provide data for the subreport.

Configure Drilling Reports

You can configure a drill-down report by defining the drill-down operation that allows you to navigate from the parent report to a sub-report containing supported data.

A drilling report usually contains parameters passed to it by the parent report. Taking the sales summary report as an example, the drilling report contains a parameter with the order value. The summary report contains links to the drill-down report corresponding to each order number. Click this link to open the target report containing detailed information and pass the corresponding order ID to it.

Any report stored on the Report Server can be a drill-down report. You can only add drilling links to text boxes and images.

Add drilling Report link
  1. In graphic design mode, open the client report definition (. rdlc) file.

  2. Right-click the text box or image to which you want to add a link, and then click Properties ".

  3. On the "navigation" tab, select "Jump to report ".

  4. Type or select a report name. The report must be a. rdlc file in the same project.

  5. To set parameters that are passed to the drilling report, click "Parameters" and then perform the following operations:

    • In "parameter name", type the name of the report parameter in the drilling report.

      Note:

      The name in the parameter list must exactly match the expected parameter name in the target report. If the name does not match or an expected parameter is not listed, the drilling report will fail.

       

    • In "parameter value", type or select the parameter value that you want to pass to the drilling report.

      Note:

      A value can contain an expression that calculates the value passed to the report parameter. The expression in the Value List includes the field list of the current report.

       

To provide data for a drilling Report, the application must process the drillthrough event of the reportviewer object. Drillthrougheventargs is one of the parameters passed to the drillthrough event handler method. Drillthrougheventargs has a report attribute used to represent a drill-down report. In the event processing program, the host application can call the getparameters () method on the drill-down report to check the parameter values passed to the drill-down report. Then, the host application must use the CES attribute of the drilling report to provide data for the drilling report.

For more information, see concepts.

Define report parameters in a reportviewer report
Add interaction, visibility, and navigation to reportviewer reports
Other resources

Examples and drills

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.