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)
How to set parameter value to a Label
Viznu
Hello,<br />
I am trying to set the parameter value to a Label in the report(DE API). <br />
<br />
List parameterList = designHandle.getAllParameters();<br />
<br />
LabelHandle lblReportHead = ( LabelHandle ) designHandle.findElement( "lblHeader" );<br />
lblReportHead.setText((String)parameterList.get(0)) ;<br />
lblReportHead = ( LabelHandle ) designHandle.findElement( "lblDetails1" );<br />
lblReportHead.setText((String)parameterList.get(1)) ;<br />
<br />
But getting the following error at "lblReportHead.setText((String)parameterList.get(0)) ;"<br />
<strong class='bbc'>java.lang.ClassCastException: org.eclipse.birt.report.model.api.ScalarParameterHandle cannot be cast to java.lang.String</strong><br />
<br />
I don't know how to use the ScalarParameterHandle class for this. Please help.
Find more posts tagged with
Comments
bricombs
Good Day
Is there any reason that you can't use the "onCreate" event of the Label and add the following code:
this.text = reportContext.getParameterValue("Parm1");
Viznu
Ya, Big reason - I didn't know there is a "script section". :rolleyes:
Thanks Brian. Its working fine now.