Skip to content

Commit 5b5bb71

Browse files
authored
Update report-book-parameters.md
1 parent de22481 commit 5b5bb71

File tree

1 file changed

+67
-9
lines changed

1 file changed

+67
-9
lines changed

designing-reports/report-book/report-book-parameters.md

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,86 @@ previous_url: /designing-reports-reportbook-report-parameters
1111

1212
# Report Book Parameters Overview
1313

14-
Often one or more reports that are part of a report book will contain report parameters. The report book is shown as a single document in the report viewer and the parameters area represents the visible report parameters defined in all child reports.
14+
Often, one or more reports that are part of a report book will contain report parameters. The report book is shown as a single document in the report viewer and the parameters area represents the visible report parameters defined in all child reports.
1515

1616
Telerik Reporting provides a mechanism known as parameter merging. If the [`Name`](/api/Telerik.Reporting.IReportParameter#Telerik_Reporting_IReportParameter_Name) and [`Type`](/api/Telerik.Reporting.IReportParameter#Telerik_Reporting_IReportParameter_Type) of two (or more) parameters from different reports are the same, then they are considered equivalent and are displayed as a single parameter in the viewer's Parameters Area.
1717

18-
>note When one or more parameters are merged the UI settings of the __first__ one are used for the generated input control in the parameters area.
18+
>note When one or more parameters are merged, the UI settings of the __first__ one are used for the generated input control in the parameters area.
1919
2020
![An image showing how the values of the Report Parameters of multiple Reports with same names are merged together when Mergeable is true](images/ReportBook3_MergedParameters.png)
2121

2222
You can control parameter merging via the [`Mergeable`](/api/Telerik.Reporting.IReportParameter#Telerik_Reporting_IReportParameter_Mergeable) boolean property of the `ReportParameter` class. The default value of the `Mergeable` property is true. Set the `Mergeable` property to `false` if you want to prevent a parameter from being merged with its equivalent ones.
2323

2424
![An image showing how the values of the Report Parameters of multiple Reports with same names keep their individual values when Mergeable is false](images/ReportBook4_MergedParameters2.png)
2525

26-
## Passing Values for Report Parameters in a Reportbook through ReportSource
26+
## How to set a value for a report parameter in ReportBook
27+
28+
In the sample pictures below, you will see in few steps how to set a value for a report parameter in ReportBook using Standalone Designer. For this example, the **Dashboard.trdp** and **Product Sales.trpd** reports are used, which can be found in the installation folder - **C:\Program Files (x86)\Progress\Telerik Reporting 2025 Q1\Report Designer\Examples**.
29+
30+
### In Standalone Designer
31+
32+
1. Click on the **Dashboard.trdp**
33+
1. From the Toolbar, click on the **Parameters**
34+
1. The **Edit Parameter** window will open, then select New
35+
36+
![How to set a value for a report parameter using Standalone Designer](images/SetValueForReportParameterInReportBookStandaloneDesigner.png)
37+
38+
### Web Report Designer
39+
40+
1. In Report Sources, click on the `uriReportSources1 `
41+
1. Next to Parameters, you will see a plus sign(+). Click on it.
42+
1. In the `Add New Item` window, you will be able to set the name and value of the parameter.
43+
44+
![How to set a value for a report parameter using Web Report Designer](images/HowToSetValueForReportParameterWebReportDesigner.png)
45+
46+
![How to set the name and value of the parameter](images/HowToSetTheNameAndValueOfTheParameter.png)
47+
48+
## Passing Values for Report Parameters in a Reportbook through ReportSource Programatically
2749

2850
* __When report parameters have unique names or the target parameters are merged:__ If a parameter is distinguishable by its Name property or the Name denotes several merged parameters, refer to the parameter directly by the value of its Name property.
2951

30-
{{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=Set_Values_For_Unique_Or_Mergable_ReportParameters_In_ReportSource_Snippet}}
31-
{{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=Set_Values_For_Unique_Or_Mergable_ReportParameters_In_ReportSource_Snippet}}
52+
````C#
53+
var UriReportSource = new Telerik.Reporting.UriReportSource();
54+
UriReportSource.Uri = "MyReportBook.trdp";
55+
56+
// Passing a value for a unique or repeating report parameter that should have one and the same value
57+
// for all reports part of the report book through the report source
58+
UriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("ProductCategory", "Bikes"));
59+
````
60+
````VB.NET
61+
Dim UriReportSource As New Telerik.Reporting.UriReportSource()
62+
UriReportSource.Uri = "MyReportBook.trdp"
63+
64+
' Passing a value for unique Or repeating report parameter that should have one And the same value
65+
' for all reports part of the report book through the report source
66+
UriReportSource.Parameters.Add(New Telerik.Reporting.Parameter("ProductCategory", "Bikes"))
67+
````
68+
69+
* __When report parameters have repeating names but they are not merged:__ In this case, you need to refer to the individual occurrence of the parameter in a particular report. This is done by denoting the target report by its zero-based index inside the report book.
70+
71+
````C#
72+
var UriReportSource = new Telerik.Reporting.UriReportSource();
73+
UriReportSource.Uri = "MyReportBook.trdp";
74+
75+
// Passing a value for not mergeable report parameter targeting the FIRST report in the report book
76+
//through the report source
77+
UriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("reports(0).ClientID", 102));
78+
79+
// Passing a value for not mergeable report parameter targeting the SECOND report in the report book
80+
//through the report source
81+
UriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("reports(1).ClientID", 103));
82+
````
83+
````VB.NET
84+
Dim UriReportSource As New Telerik.Reporting.UriReportSource()
85+
UriReportSource.Uri = "MyReportBook.trdp"
3286

33-
* __When report parameters have repeating names but they are not merged:__ In this case you need to refer to the individual occurrence of the parameter in a particular report. This is done by denoting the target report by its zero-based index inside the report book.
87+
' Passing a value for Not mergeable report parameter targeting the FIRST report in the report book
88+
' through the report source
89+
UriReportSource.Parameters.Add(New Telerik.Reporting.Parameter("reports(0).ClientID", 102))
3490

35-
{{source=CodeSnippets\CS\API\Telerik\Reporting\ReportSourceSnippets.cs region=Set_Values_For_NotMergable_ReportParameters_In_ReportSource_Snippet}}
36-
{{source=CodeSnippets\VB\API\Telerik\Reporting\ReportSourceSnippets.vb region=Set_Values_For_NotMergable_ReportParameters_In_ReportSource_Snippet}}
91+
' Passing a value for Not mergeable report parameter targeting the SECOND report in the report book
92+
' through the report source
93+
UriReportSource.Parameters.Add(New Telerik.Reporting.Parameter("reports(1).ClientID", 103))
94+
````
3795

38-
>note If you do not use the specified syntax and you refer to the report parameter directly by the `Name` property's value, the value will be set only for the _first_ occurrence of report parameter in the report book.
96+
>note If you do not use the specified syntax and you refer to the report parameter directly by the `Name` property's value, the value will be set only for the _first_ occurrence of the report parameter in the report book.

0 commit comments

Comments
 (0)