While the project is in the development stage, many things change. Files are moved, folders are renamed, and sometimes requirements change. This often results in re-work.
Assume that a crosstab report has been designed to drill to a target report from intersection. The drill target report accepts many parameters and their mapping is already done. However, because of some changes in business requirement, the drill from intersection now needs to go to another report. That report is already designed to accept the same parameters; we only need to change the target in the main report.
In this recipe, we will see how to quickly change the target report for a drill-through definition, without the need to map the parameters again.
Create a crosstab report shown as follows and save it as '5.1 Drill from crosstab intersection'.
Create drill-through link from the crosstab intersection to a list report and pass multiple values. This list report can be just a simple one shown as follows. Save this report as '5.1 Drill from crosstab intersection Drill 2'.
Create one more copy of the above report and save it as '5.1 Drill from crosstab intersection Drill 1'.
So, now we have the following folder structure:
The main report (5.1 Drill from crosstab intersection) has been designed to call '5.1 Drill from crosstab intersection Drill 2'. We will change it to call 'Drill 1' instead by editing XML. This way we will not have to define the parameter mapping again and it will save the developer's time.
Notice that the drill through has been designed to go to 5.1 Drill from crosstab intersection Drill 2 and passes two parameters called Month and OrderMethod. In real life, you will usually have many parameters passed.
Drill
2
with that of Drill
1
. In our recipe, we will search for all instances of :'/content/package[@name='GO Data Warehouse (query)']/folder[@name='Chapter 5']/report[@name='5.1 Drill from crossab intersection Drill 2']'
and replace them with :
'/content/package[@name='GO Data Warehouse (query)']/folder[@name='Chapter 5']/report[@name='5.1 Drill from crossab intersection Drill 1']'
In Report Studio, if you change the target report for an existing drill-through definition, then it wants to redefine the parameter mapping. Here we are achieving that without the need to redefine the mapping.
For that we are directly modifying the XML specification of the report. When we copy a report to clipboard, its XML spec is copied. We then edit it in an editor, and replace all the references to 'Drill 2' report with 'Drill 1' report.
Finally, we copy the modified the XML back into Report Studio and find that the drill target is successfully changed.