Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Exporting report parameters
evgenyak
Hello,
I have a lot of reports and most of them have several parameters.
But, once, for example, PDF is created it's not possible to know what the parameters were.
Is it possible to automatically show the parameters and their values in exported reports ?
Thanks,
Find more posts tagged with
Comments
DispatchMG
You could output the parameters in the footer or some other element of the report so that once it's run and generated, the parameters used to build the report show in their own <div> or something of that nature. For example, in the footer of my Master Page layout, I have the following code:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<span><b>Report run on</b> <value-of>new Date()</value-of></span><br />
<span><b>Product ID:</b> <value-of>params["productIdParam"].value</value-of></span><br />
<span><b>Report Start Date:</b> <value-of>params["startParam"].value</value-of></span><br />
<span><b>Report End Date:</b> <value-of>params["endParam"].value</value-of></span><br />
</pre>
<br />
Of course, you can use better HTML than I did and some CSS instead of style tags, but this should get ya started.
evgenyak
<blockquote class='ipsBlockquote' data-author="'DispatchMG'" data-cid="82630" data-time="1315924021" data-date="13 September 2011 - 07:27 AM"><p>
You could output the parameters in the footer or some other element of the report so that once it's run and generated, the parameters used to build the report show in their own <div> or something of that nature. For example, in the footer of my Master Page layout, I have the following code:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<span><b>Report run on</b> <value-of>new Date()</value-of></span><br />
<span><b>Product ID:</b> <value-of>params["productIdParam"].value</value-of></span><br />
<span><b>Report Start Date:</b> <value-of>params["startParam"].value</value-of></span><br />
<span><b>Report End Date:</b> <value-of>params["endParam"].value</value-of></span><br />
</pre>
<br />
Of course, you can use better HTML than I did and some CSS instead of style tags, but this should get ya started.<br /></p></blockquote>
<br />
Awesome!! This was very helpful.<br />
<br />
I have a more complex question though.<br />
Suppose that some parameter is based on some other data source where I have numbers and their names. For example:<br />
[1][Red]<br />
[2][Green]<br />
[3][Blue]<br />
I have a datasource which brings them.<br />
The parameter for the report is one of the numbers [1][2][3].<br />
But, is there a way to dynamically convert them to their values [Red][Green][Blue] so that I could add it to page footer as well?<br />
<br />
Thanks!!
DispatchMG
Haha, I literally <em class='bbc'>just</em> figured this out for myself! Anyway, this is quite easy to do. Instead of <span style='font-family: Courier New'>.value</span>, use <span style='font-family: Courier New'>.displayText</span>:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<span><b>Report Order Status:</b> <value-of>params["orderStatusParam"].displayText</value-of></span><br />
</pre>
evgenyak
<blockquote class='ipsBlockquote' data-author="'DispatchMG'" data-cid="82764" data-time="1316026265" data-date="14 September 2011 - 11:51 AM"><p>
Haha, I literally <em class='bbc'>just</em> figured this out for myself! Anyway, this is quite easy to do. Instead of <span style='font-family: Courier New'>.value</span>, use <span style='font-family: Courier New'>.displayText</span>:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<span><b>Report Order Status:</b> <value-of>params["orderStatusParam"].displayText</value-of></span><br />
</pre></p></blockquote>
<br />
For some reason I get an empty string when I'm using "displayText". <br />
This is how I define a parameter:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<scalar-parameter name="Filter_Bearer" id="104">
<text-property name="promptText">Bearer Network</text-property>
<property name="valueType">dynamic</property>
<property name="isRequired">false</property>
<property name="dataSetName">bearerDataSet</property>
<expression name="valueExpr" type="javascript">dataSetRow["bearer_id"]</expression>
<expression name="labelExpr" type="javascript">dataSetRow["bearer"]</expression>
<property name="dataType">integer</property>
<property name="distinct">true</property>
<simple-property-list name="defaultValue">
<value type="constant">-1</value>
</simple-property-list>
<property name="paramType">simple</property>
<property name="controlType">list-box</property>
<property name="mustMatch">false</property>
<property name="fixedOrder">true</property>
<property name="autoSuggestThreshold">1</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</pre>
DispatchMG
Hmm, comparing your parameter to mine, it looks just fine. Here's my parameter definition:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<scalar-parameter name="orderStatusParam" id="489">
<text-property name="promptText">Choose an order status</text-property>
<property name="valueType">dynamic</property>
<property name="dataSetName">OrderStatuses</property>
<expression name="valueExpr" type="javascript">dataSetRow["orders_status_id"]</expression>
<expression name="labelExpr" type="javascript">dataSetRow["orders_status_name"]</expression>
<expression name="sortByColumn">dataSetRow["orders_status_name"]</expression>
<property name="sortDirection">desc</property>
<property name="dataType">integer</property>
<property name="distinct">true</property>
<property name="paramType">simple</property>
<property name="controlType">list-box</property>
<property name="mustMatch">false</property>
<property name="fixedOrder">false</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</pre>
<br />
And in the footer of my master layout, I have this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<span><b>Report run on</b> <value-of>new Date()</value-of></span><br />
<span><b>Report Start Date:</b> <value-of>params["startParam"].value</value-of></span><br />
<span><b>Report End Date:</b> <value-of>params["endParam"].value</value-of></span><br />
<span><b>Report Order Status:</b> <value-of>params["orderStatusParam"].value</value-of> :: <value-of>params["orderStatusParam"].displayText</value-of></span><br />
</pre>
<br />
I would recommend double-checking for typos or small oversights. I would assume that your drop-down, or whatever construct you're using, displays the labels and values correctly, both on the page and in the source code?