Multiple Select Values Hyperlinks

SailRCG
edited July 28, 2021 in Analytics #1
Here is an example which will demonstrate two functions and an ‘if statement’ in the initialize that can make a report very flexible. The two functions build a list of comma separated values from ‘Multiple-Select’ enabled parameters. The ‘if statement’ and variables in the initialize is used with a hyperlink to choose between two ‘themes’ depending on desired output.<br />
<br />
To use the example you will extract the rptdesign and rptlibrary files and import them into your report project. Include the library in your shared resources and make the rptlibrary file available to the rptdesign file.<br />
<br />
When everything is setup correctly you will see this:<br />
<br />
ReportLibraryLinked.png<br />
<br />
Go to the Master Page tab and define the hyperlink value for the ‘Printable Version’ label.<br />
<br />
Hyperlink%20with%20Parameters1.png<br />
<br />
Use the expression builder for the ‘paramProductName’ parameter, to leverage the buildParamList() function. The ‘Report Data Set’ will have ‘beforeOpen’ scripted to use buildWhereClause() for the multiple selections of the paramProductName values.<br />
<br />
BuildParamsListFunction.png<br />
<br />
When you first run the report you’ll see the entire unrestricted report output, as the visible parameter is not required. So, for you to test the passing of a string of multiple selected values to a report parameter in a hyperlink, select the show ‘Parameters’ from the toolbar and select a few product names at random.<br />
<br />
SelectedProductNames.png<br />
<br />
Run the report and you’ll see something like:<br />
<br />
ColorReportOutput.png<br />
<br />
Select the ‘Printable Version’ link and you’ll see:<br />
<br />
BWReportOutput.png<br />
<br />
Notice the multiple select parameters are shown as passed from the hyperlink definition