In this post we have a look at how ReportServer exposes reports via the URL and how this can be used to implement drilling.
Exporting Reports via the URL
which, for example, allows to incorporate reports into external applications.
The export is controlled using the following parameters:
- id: The id of the to exported report. Alternatively you can use the parameter key to identify the report
- key: The key of the to exported report. Can be used as an alternative to id. Note that, one of the two needs to be present
- format: The export format: for example, html, pdf, csv, excel, png
- p_: Can be used to set parameter values. Assume you have a parameter with key customernr then you can set the parameter by specifying p_customernr=123. If the parameter takes multiple values these are separated by the pipe character “|”.
- c_i: Defines the i-th column. The column is specified using its technical name. Additionally, you can provide an alias for the column. A possible configuration could look like: c_2=ID|fooID. That is, the second column is the column with name ID and its alias is set to fooID.
- allcolumns: Can be used instead of c_ to simply select all available columns. Note that then it is not possible to further configure the individual columns.
- agg_i: Configures an aggregation for the i-th column. Possible values are: AVG, COUNT, MAX, MIN, SUM, VARIANCE, COUNT_DISTINCT
- h_i: Hides the i-th column.
- or_i: Defines the order of the i-th column. Possible values are: ASC (ascending), DESC (descending).
- fi_i: Sets an inclusion filter for the i-th column. Multiple filter values are separated by a pipe “|”. For example: fi_1=FILTER_A|FILTER_B|FILTER_C
- fri_i: Defines an inclusion range filter for the i-th column. Multiple ranges are separated using the pipe character “|” and the range itself is separated using ” – “.
- fe_i: Defines exclusion filters similar to fi_i.
- fre_i: Defines exclusion range filter similar to fi_i.