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)
displayText is null when passing parameters through URL for PDF
lendjones
<p>Hi, </p>
<p> </p>
<p>I'm trying to generate a .PDF of a parameter, by passing in the params using the URL convention. </p>
<p> </p>
<p>My url is: </p>
<div><a data-ipb='nomediaparse' href='
https://pmapps.fiscal.treasury.gov/PFC-BIRT/frameset?__report=BusinessDayReport_Quarterly.rptdesign&Quarter=14&To_Date=2015'>https://pmapps.fiscal.treasury.gov/PFC-BIRT/frameset?__report=BusinessDayReport_Quarterly.rptdesign&Quarter=14&To_Date=2015</a></div>
;
<div> </div>
<p> </p>
<p>Where I'm using "params["Quarter"].displayText" and "params["To_Date"].displayText" I see null and null on the report. </p>
<p> </p>
<p>The report just receives two parameters. A Quarter param and a To_Date param. </p>
<p> </p>
<p>I don't understand why the passed in parameters aren't having their displayText displayed. </p>
Find more posts tagged with
Comments
JFreeman
<p>What version of BIRT are you using?<br>
Can you attach a sample report that demonstrates your configuration and this behavior?</p>
<p> </p>
<p>Passing the parameters through the URL like you have shown should work.</p>
<p>I just did a simple test and was able to display the values of parameters properly in a PDF output generated through a URL like you have shown.</p>
lendjones
<blockquote class="ipsBlockquote" data-author="JFreeman" data-cid="136249" data-time="1431979199">
<div>
<p>What version of BIRT are you using?<br>
Can you attach a sample report that demonstrates your configuration and this behavior?</p>
<p> </p>
<p>Passing the parameters through the URL like you have shown should work.</p>
<p>I just did a simple test and was able to display the values of parameters properly in a PDF output generated through a URL like you have shown.</p>
</div>
</blockquote>
<p> </p>
<p>I'm using "Eclipse BIRT Designer Version 4.4.2" to design the report. On the server we're using Viewer Version : 4.3.1 and</p>
<p>Engine Version: 4.3.1. </p>
<p> </p>
<p>I've attached a sample report. </p>
<p> </p>
<p>When I click run and preview as PDF, it works fine. It seems to only return null when I use the URL parameters. </p>
JFreeman
<p>Interesting, it seems as though the viewer doesn't like .displayText when the value is set through the URL.</p>
<p> </p>
<p>Can you use .value instead?</p>
<p>For Example: params["paramName"].value</p>
<p> </p>
<p>On a side note, you should consider aligning your designer version and server's runtime version. 4.4.2 and 4.3.1 are somewhat close so I don't necessarily think you will run into too many issues but it is best to align your designers version with the version of the runtime that the reports will be running against.</p>
lendjones
<blockquote class="ipsBlockquote" data-author="JFreeman" data-cid="136256" data-time="1431987254">
<div>
<p>Interesting, it seems as though the viewer doesn't like .displayText when the value is set through the URL.</p>
<p> </p>
<p>Can you use .value instead?</p>
<p>For Example: params["paramName"].value</p>
<p> </p>
<p>On a side note, you should consider aligning your designer version and server's runtime version. 4.4.2 and 4.3.1 are somewhat close so I don't necessarily think you will run into too many issues but it is best to align your designers version with the version of the runtime that the reports will be running against.</p>
</div>
</blockquote>
<p> </p>
<p>It does work with value. Is there a way to implement some logic to display certain given a corresponding parameter value? </p>
JFreeman
<p>Could you be more specific about what you are wanting to implement?</p>
<p>I'm not clear on what you want to do based on the value of a parameter.</p>
<p> </p>
<p>In general, it is possible to write logic based on the value of a parameter but I need more details to be more specific.</p>
lendjones
<p>I want use .displayText really, but if that's not an option I'd like to display a text string given a parameter value. </p>
<p> </p>
<p>So, for example if the value of the Quarter Parameter passed through the URL is 14, I'd like to have a text element in the report display "First Quarter." </p>
<p> </p>
<p>I wanted to use .displayText for that option, but are you saying that doesn't work when passing the parameters through URL?</p>
JFreeman
<p>Correct, displayText does not work properly when the parameters are passed through a URL. There is a known bug on this issue: <a data-ipb='nomediaparse' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=305319'>305319</a>.</p>
;
<p> </p>
<p>You should be able to perform logic based on the .value of a parameter similar to how you would with .displayText.</p>
lendjones
<blockquote class="ipsBlockquote" data-author="JFreeman" data-cid="136270" data-time="1432049146">
<div>
<p>Correct, displayText does not work properly when the parameters are passed through a URL. There is a known bug on this issue: <a data-ipb='nomediaparse' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=305319'>305319</a>.</p>
;
<p> </p>
<p>You should be able to perform logic based on the .value of a parameter similar to how you would with .displayText.</p>
</div>
</blockquote>
<p> </p>
<p>Where would I place that logic? In the expression builder for the dynamic text element? Or in the script? </p>
<p> </p>
<p>Thanks for the help I really appreciate it. </p>
lendjones
<p>Never mind, I was able to implement it. </p>
<p> </p>
<p>I created a report variable and placed the following code for my purposes in the beforeFactory script of the report: </p>
<p> </p>
<div>
<pre class="_prettyXprint">
if (params["Quarter"].value == 13) {
vars["Quarter Text"] = "First Quarter";
} else if (params["Quarter"].value == 14) {
vars["Quarter Text"] = "Second Quarter";
} else if (params["Quarter"].value == 15) {
vars["Quarter Text"] = "Third Quarter";
} else if (params["Quarter"].value == 16) {
vars["Quarter Text"] = "Fourth Quarter";
} else {
vars["Quarter Text"] = "Unknown Quarter";
}</pre>
</div>
JFreeman
<p>Thank you for the update and posting your solution.</p>
<p>I'm glad to hear you got it working.</p>