Monday, February 24, 2014

Creating a Hierarchical Report by Linking Reports

The third approach to building hierarchical reports is implemented using two independent reports that are linked together. In fact, this approach can be used effectively to create a “web” of reports. Instead of embedding the details in the master report, they’re contained in a separate “stand-alone” report.

Step 1: Copy the previous hierarchical report 

We’ll base this hierarchical report on the previous report developed in Chapter 3. So, as before, copy the “Chapter3Report2” report and rename the copy to “Chapter3Report3”.


Step 2: Provide a link from the summary report to the detail report. 

Replace the Action.ShowElement (“actShowOrderDetails”) element beneath the customer ID column (“colCustomerID”) with an Action.Report element and, beneath it, add a Target.Report element. By selecting and dragging, move the Link Params element from beneath the Sub-Report (“sbrOrderDetails”) to it as well.

Figure 3.30: Definition Editor Panel after modifying Action elements
Set the Target.Report element’s Report Definition File attribute to reference the sub-report developed in the previous section. Notice that, when the attribute is selected, you can select from a list of reports in the project that appears in the Suggestions panel.

Figure 3.31: Definition Editor Panel after setting Target element attributes
Step 3: Remove the sub-report.

Remove the More Info Row (“mirOrderDetails”) element and all its child elements. 

Figure 3.32: Definition Editor Panel after removing elements

At this point, the hierarchical report is fully functional, and the summary report should look similar to the original report. When the user selects a Customer ID, the order details for the selected user are displayed in a separate detail report as shown below.

Figure 3.33: Report Preview Panel showing detail report

Of course, these are not the only options for building your reporting application, and these approaches are not mutually exclusive. Often, a combination of two or more of these approaches is used to provide an effective, intuitive reporting application. 

No comments:

Post a Comment