Hello,
I have a Custom Data Source with two properties. I implemented property binding so those properties are set at runtime (report generation).
If I launch report designer using 'Launch an Eclipse application' from plugin tools (in this case custom data source plugin) and run report, the two parameters are asked, i fill in the values and the report is generated correctly.
When i generate the report programatically (custom data source plugin is in report_engine_home/plugins), something fails, the parameters or the property binding, because the oda connection that uses the properties receives the properties with value null.
I use exactly the same code that is in
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php .
Can you give me any tip of what may be happening? Here is my code:
EngineConfig dConfig = new EngineConfig();
dConfig.setBIRTHome("C:/birt-runtime-2_3_2/ReportEngine" );
ReportEngine engine = new ReportEngine( dConfig );
IReportRunnable runnable = null;
//Open the report design
IReportRunnable design = engine.openReportDesign("C:\\birt\\somedesign.rptdesign");
//Create task to run and render the report,
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
String parm1 = "
http://getdatasource"
String parm2 = "<?xml version="1.0" encoding="UTF-8"?><runtime_data></runtime_data>";
//Set parameter values and validate
task.setParameterValue("datasource_parm", parm1);
task.setParameterValue("runtimedata_parm", parm2);
task.validateParameters();
//Setup rendering to HTML
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("C:\\some_report.html");
options.setOutputFormat("html");
//Setting this to true removes html and body tags
options.setEmbeddable(false);
task.setRenderOption(options);
//run and render report
task.run();
task.close();