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)
Changing the label text using DE or RE API !
bholenath
Hi All,
I've a requirement wherein the users can change the labels in the report. The report could consist of multiple sections having different UI controls -- like labels, text fields, checkboxes etc.
At the run-time, my program will call DE or RE APIs and change the label text as per the input given by user (as report parameters).
Is there a way that I can get hold of all the elements in the report - i.e. if my report has a table and a grid, then I can get the handles for both of them. But I couldnt get the handle for the labels within the table and grid ? Is there a way for this -- any API classes ?
Thanks in advance,
Cheers,
Amit
Find more posts tagged with
Comments
JasonW
You can modify the label in its script or in the beforeFactory. If you do it in the beforeFactory name it in the general properties and use code like:
//mylabel2 is the name
var ldh = reportContext.getDesignHandle().findElement("mylabel2");
ldh.setText("hello");
Jason
bholenath
Thanks a lot, Jason. I'm indeed making use of the same 2 methods that you had mentioned -- findElement() and setText().
However for me, the objective was to make use of Java API as much as possible - rather than JavaScripting. I am making use DesignElementHandle using the ReportDesignHandle to get the work done.
JasonW
Then you should be able to do the same like:
IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("Reports/TopNPercent.rptdesign");
ReportDesignHandle report = (ReportDesignHandle) design.getDesignHandle( );
report.findElement("mylabel2").setText("hello");
Jason