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)
Change image url before run task
frenchGuy
Hi,<br />
<br />
I am generating a report using a Report Engine classes and I would like to change the url of an image inserted in the report using BIRT Report Designer.<br />
<br />
Is it possible to access this item and change its properties before the generation?<br />
<br />
this is a sample of my code :<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
IReportEngine engine = null;
engine = Engine.getInstance().getEngine();
IReportRunnable design = null;
// Open the report design
try {
design = engine.openReportDesign(report.getSource());
} catch (EngineException e) {
LoggerBI.getInstance().fatal("", e);
return false;
}
IRunAndRenderTask runtask = engine.createRunAndRenderTask(design);
ULocale lc = new ULocale(task.getLocale());
runtask.setLocale(lc);
runtask.setParameterValues(reportParams);
try {
runtask.run();
} catch (EngineException e) {
LoggerBI.getInstance().error("", e);
return (false);
}
runtask.close();
</pre>
<br />
Thanks!
Find more posts tagged with
Comments
CBR
Yes this is possible.
The IReportRunnable interface has a method called getDesignHandle() this method gives you a reference to the ROM of your report. You can use it to access the representation of any object in the report you loaded.
Simply add
imageHandle = design.getDesignInstance().getImage("myImage");
imageHandle.setURL("My new URL");
One last thing to do:
Open your report and name the image you want to change myImage