Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
special characters in titles
SmokesMom
We have a stand alone application that listens for report requests from other applications. The other applications pass a url string to the stand alone and it serves up the BIRT report.
I have a report that allows the user to specify a title and pass the title in as a parameter to the report design. For example: "All Properties for Period x thru z" or "A & B Property".
When I pass in an ampersand as part of the title parameter, everything after the ampersand does not appear. What can I do to make this appear correctly in the title? Is this an XML issue?
Thanks for your help,
Kris
Find more posts tagged with
Comments
mwilliams
Since you're passing the value from the external app by a URL to your report application, you'll need to use URL encoding to send the &, since it's a special character in URLs. So, on your application side, where you take the title parameter in, you'll need to check the entered value for '&' and replace it with '%26' before placing it in the URL.
SmokesMom
Hello again,
I'm still struggling with this. I have a report parameter &rp_title that has a value passed in:
&rp_title=A+%26+B+Signs&rp_nextParameter...
In my expression builder for the field I have:
lTitle = reportContext.getParameterValue("rp_title");
lTitle.toString().replace("%26", "&")
My title still comes out A %26 B Signs.
I've tried doing the same thing in a persistant global variable in an onCreate, onRender, onPrepare, but I still get the same results.
Once I have the url encoded how do I decode it in the report?
Thanks again for your help.
Kris
mwilliams
Where are you trying to set this value? If I pass &rp_title=A%20%26%20B%20Signs, then in an HTML text box, put: <value-of>params["rp_title"]</value-of>. This give me A & B Signs, in the text box. Can you explain more about this?
SmokesMom
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="110309" data-time="1349806930" data-date="09 October 2012 - 11:22 AM"><p>
Where are you trying to set this value? If I pass &rp_title=A%20%26%20B%20Signs, then in an HTML text box, put: <value-of>params["rp_title"]</value-of>. This give me A & B Signs, in the text box. Can you explain more about this?<br /></p></blockquote>
<br />
<br />
Hi, thanks for your quick reply. I tried what you sent here. Still getting the same issue. Having said that, is it because I can't really test this running from within the designer and just populating the parameters in the Show Report Parameters popup?<br />
<br />
Thanks,
mwilliams
If you go to window->preferences->report design->preview and check the always use external browsers check box, you can run it in the viewer and enter the value in the query string and re-submit.
SmokesMom
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="110309" data-time="1349806930" data-date="09 October 2012 - 11:22 AM"><p>
Where are you trying to set this value? If I pass &rp_title=A%20%26%20B%20Signs, then in an HTML text box, put: <value-of>params["rp_title"]</value-of>. This give me A & B Signs, in the text box. Can you explain more about this?<br /></p></blockquote>
SmokesMom
Sorry - got carried away with the post button.
Thanks for the Windows Preferences tip - I wasn't aware of that.
Having said that, still no luck here.
mwilliams
What's your BIRT version? I'll make an example and have you run it in the web viewer and then add the parameter to the URL.
SmokesMom
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="110326" data-time="1349813741" data-date="09 October 2012 - 01:15 PM"><p>
What's your BIRT version? I'll make an example and have you run it in the web viewer and then add the parameter to the URL.<br /></p></blockquote>
<br />
Thanks again for your reply. I got it to work. I needed to add the &rp_title parameter to the url (sorry - rather brain dead sometimes)<br />
<br />
Thanks for all your help - my end-user will be pleased.
mwilliams
No worries. Happens to me, all the time!
Let us know whenever you have questions!