Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
DevShare Downloads
Conditional Drill-Through
Migrateduser
The attached BIRT project illustrates two separate methods of implementing a conditional drill-through. In the examples, sales data from the sample database is used to build a summary report. On that summary report the user is able to drill-through to a detail view. Based on the profit margin threshold (40%) they will be directed to either Detail Report A (> 40%) or Detail Report B (< 40%). In the case of the bookmark example, there are two targets in the same report, a different bookmark is target based on the threshold (Detail Report 3).
<br />
<br />
There are some things to watch out for that I go into in the details below. Namely in the case of the conditional drill-through targeting a unique report, the functionality will not work inside the default BIRT viewer. This is because we have to manually build the target URL inside the expression builder. That being the case, we short-circuit BIRTs ability to create the appropriate URL structure based on the context at run time. The URL built will function when the report is uploaded to iServer (or iServerExpress). The URL leverages the executeReport.do Servlet which is available via Portal, but not in the BIRT viewer. The conditional drill-through targeting a bookmark is not limited in this way and will function in both the BIRT viewer and iPortal as designed.
<br />
<br />
Project Details & Specifics:
<br />
There are two "root" reports and three "target" reports. The root reports are named Summary_TargetReport and Summary_TargetBookmark; the target reports are named Detail1-3.
<br />
<br />
1)
Summary_TargetReport.rptdesign
: I think the name is pretty self explanatory. The pie chart on this report features a dynamic drill-down to either Detail1.rptdesign or Detail2.rptdesign. These are the same report, they simply have some different coloring so you can easily tell the conditional logic is working. The logic inherent in the drill-down is that if the profit margin for a given product line is below 40%, target Detail2.rptdesign. If the margin is greater than 40%, target Detail1.rptdesign. The click through also passes a parameter so the detail report only shows the selected product line. The conditional logic is handled by building an expression on the interactivity settings for the Value Series of the chart. It is straightforward to copy and reuse this strategy in other reports going forward. The URL built in the expression will function in iPortal, but not in the BIRT designer. Because we have to dynamically build the URL, we loses some of the "smarts" of the BIRT URL building algorithm. To truly test the drill-down, the report must be uploaded to iPortal/iServer (or iServerExpress) and run from there. This is the one limitation of this strategy; it is a design-time limitation and will in no way affect a production system.
<br />
<br />
2)
Summary_TargetBookmark.rptdesign
: This report is built using a more standard approach. The idea here is that the drill-down has a single report as its target and the bookmark loaded on that target report changes based on some condition. In the case of this sample, the same profit margin threshold is used for this report as is used above. The only difference being the target report contains two tables, and one of them is focused on at run time based on the specified bookmark. When configuring a drill-down of type Hyperlink, the specification of a bookmark can be a dynamic expression. This is where I added the conditional logic in this sample. This approach is a bit more flexible as the report and the drill down will function in both iPortal and the BIRT designer. The trade-off is that you are not targeting a unique report, just a sub-section of a larger report.
Find more posts tagged with
Comments
There are no comments yet