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)
Truncate URL text but keep the hyperlink
cvh
Hello all. I'm very much a BIRT novice.<br />
<br />
I'm using the following code in the 'onRender' section of the script page to set the hyperlink in a column of my report:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var myaction = this.createAction();
myaction.setHyperlink(this.getValue(),"_blank");
this.action = myaction;</pre>
<br />
This works nicely. <br />
<br />
However, I'd like to truncate the text representation of the URL when its exceeds a given character count, and yet retain the hyperlink itself.<br />
<br />
Can anyone give me a pointer how to do it, please?
Find more posts tagged with
Comments
cvh
[bump]
mwilliams
Sorry for the delayed response. Try something like this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var myaction = this.createAction();
myaction.setHyperlink(this.getValue(),"_blank");
this.action = myaction;
this.setDisplayValue(this.getValue().substr(0,20))
</pre>
cvh
Thanks so much, that works just fine!
mwilliams
Great! Let us know whenever you have questions!