Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic table
bhanu
Hi,
I wanted to display a dynamic table which has no database connection.
In my rptdesign I have set the parameters. And I am setting the values in the java for that
parameter.
I tried the following code for generating the dynamic table though java code.
But it is not working. It is generating only one row. I need three rows in my report.
public static void executeReport2() throws EngineException {
IReportEngine engine = null;
EngineConfig config = null;
try {
config = new EngineConfig();
config
.setBIRTHome("D:softwaresjava_utilsBirtbirt-runtime-2_5_0birt-runtime-2_5_0ReportEngine");
config.setLogConfig("c:/birt/test", Level.FINEST);
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine(config);
IReportRunnable design = null;
// Open the report design
design = engine.openReportDesign("C://temp//HelloWorld.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
// task.setParameterValue("Top Count", (new Integer(5)));
// task.validateParameters();
// HTMLRenderOption options = new HTMLRenderOption();
// options.setOutputFileName("c:/birt/test.html");
// options.setOutputFormat("html");
// options.setHtmlRtLFlag(false);
// options.setEmbeddable(false);
// options.setImageDirectory("C:testimages");
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName("c:/test1.pdf");
options.setOutputFormat("pdf");
task.setRenderOption(options);
Map<String,Object> map = new HashMap<String,Object>();
for(int i =1; i <=3;i++){
map = new HashMap<String,Object>();
map.put("column1","50"+i);
map.put("column2","column"+i);
task.setParameterValues(map);
// task.setParameterValue("column1","50");
// task.setParameterValue("column2","30/12/2009");
}
// task.setParameterValues(map);
// task.setParameterValues(map1);
//task.setParameterValue("column2","30/12/2009");
//}
task.run();
task.close();
engine.destroy();
} catch (Exception ex) {
ex.printStackTrace();
} finally {
Platform.shutdown();
}
}
Thanks
bhanu
Find more posts tagged with
Comments
mwilliams
Hi bhanu,
Where is the data coming from if not from a dataSet? What is the data you're displaying?