Drill-down reports offer useful functionality to your reports by
letting the user zoom in on details. This is achieved by using
report actions. To configure a column or datapoint to jump to another report, we will configure an Action.
There are a few different ways to implement drill-down reports. You can either
have a report that calls another report or a report that calls itself.
In any case, you must set at least one parameter, otherwise an exception
will be thrown: "Object reference not set to an instance of an object."
Creating a Drill-Down Chart through the Designer
In this example we will create a report that calls another report. The process for creating a report that calls itself is the same.
Main Report
To set up the main (calling) report, create an action on the data field(s).
Remember that you must specify at least one
parameter, even if you don't intend to use it.
Drill-down Report
In this example, the Report Parameter is used to filter the
incoming data.
Remember that you must create a code parameter to match the report parameter that is
set, even if you don't intend to use it.
Creating a Drill-Down Chart through code
With this type of report we will usually send some parameters and modify the chart (or
report) by obtaining these parameters, and acting upon them.
The user can click on a datapoint to "explode" the pie slice and
display information about that slice in a Chart title. This particular example will pass the clicked datapoint's index through a parameter and set the "exploded" property of that datapoint to true when the report loads.
To create this, follow the usual steps
you would in normally creating a Chart.
Once you have created your chart:
-
Create a report parameter that we will use to transfer the value of the clicked
datapoint.
-
Open the code editor and add a Code Parameter so you have access to the report
parameter's value:
-
In the PostApplyData event, assign the drill-down action to each datapoint:
-
In the PostApplyData event, respond according to the value of the
Code Parameter you created earlier. At
this point we are modifying the Chart in accordance to the value of the Report
Parameter.
See the report source in SelfModification.rdl in the Downloads section of
this article.
|