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)
How to add attributes to Label elements
icklebean
Is it possible to add an attribute (for example accessKey) to a label element in BIRT design report?
Find more posts tagged with
Comments
mwilliams
Hi icklebean,
Can you explain more about what you're trying to do?
icklebean
Hi,
I've got a report design with a label element in it where it contains a hyperlink set to drill-through the report itself (to produce a Next/Previous button essentially). I would like to add an accessKey attribute to the hyperlink so the users can use keyboard shortcuts (Alt-P etc). I've tried adding it as an user attribute in the User Properties tab but no luck.
Any pointers would be very much appreciated.
It is possible to use a dynamic text element and set the anchor to contain accessKey attribute but then I can't get the drill-through to work.
mwilliams
What happens with the drill through when you use a dynamic text box? Maybe you can reproduce it this way with the sample database up to the point where it failed. This way I can see what it's doing and might be able to help.
icklebean
Thanks for that Michael,<br />
<br />
Actually is it possible to create a drill-through for a dynamic text element? I tried adding the following in the beforeFactory() script event:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
dataHandle = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("previousDynamicTxt");
ac = StructureFactory.createAction();
ah = dataHandle.setAction(ac);
</pre>
<br />
(I was hoping then I could define the drill-through like:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
ah.setLinkType("drill-through");
ah.setReportName( params["detailrpt"].value +".rptdesign");
ah.setTargetFileType("report-design");
ah.setTargetWindow("_blank");
</pre>
etc)<br />
<br />
However, there is no setAction() function in TextDataHandler (it only exists for Label and Data handler) so it throws a TypeError.<br />
<br />
Many thanks again and best regards. :-)
mwilliams
I guess I've never really tried to drill-through off of a dynamic text box. Doesn't look like you have the option to do so. I know that you could build the URL to your report you'd like to drill through to by using a regular text element. There is a dynamic text option in there as well to do whatever code you need, or you could use html script tags.
icklebean
Many thanks for the pointers Michael, I'll give those ideas a shot :-)
icklebean
Michael,
Using html script tags in a text element item works! I could then get the appropriate element and add the accessKey accordingly.
Many thanks again.
Best regards,
icklebean
mwilliams
Not a problem! Always glad to help! Let us know whenever you have questions!