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)
Need to change and use Library instance without changing rptlibrary
qos
Hello,
I have a custom data source that has 2 properties. The data source is included in a library and the library is included in a report template.
One of the DS properties has to be changed when generating the report (using RE) but I don't want to save it on file because I can have multiple users asking for the report generation, and each of them will have a different value for the property. I thought that using the method reloadLibrary using library handle instance would work but it doesn't. Can you help me? Here is my code:
List<OdaDataSourceHandle> libDataSources = (List<OdaDataSourceHandle>) library.getAllDataSources();
for(OdaDataSourceHandle odsh : libDataSources){
odsh.setProperty("propertyA", propertyAvalue);
}
(...)
runnable = engine.openReportDesign( template.getFileName());
template.reloadLibrary(library.getLibrary());
IRunAndRenderTask task = engine.createRunAndRenderTask(runnable);
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName(path);
options.setOutputFormat("pdf");
task.setRenderOption(options);
task.run();
task.close();
Find more posts tagged with
Comments
qos
I have abandoned this approach and decided to use property binding, still having some problems though. If you can help me i have posted a new topic
http://www.birt-exchange.org/org/forum/index.php/topic/20452-setting-report-parameter-values-programatically/page__p__68152__fromsearch__1&#entry68152