Hiiii......
I am new to BIRT report and its deployment.
Can any help me in deploying BIRT report in simple java application.
I tried using servlets also but i'm getting a lot of error...
This is the code i tried to execute.
package report;
import org.eclipse.birt.report.engine.api.*;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.core.framework.Platform;
/**
*
*
@author training
*/
public class rpt {
public void execute(){
try{
EngineConfig config = new EngineConfig();
config.setEngineHome( " F:/report/birt-runtime-2_5_0/ReportEngine" );
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );
IReportRunnable design = engine.openReportDesign("F:/report/rpt2.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, rpt.class.getClassLoader());
task.setParameterValue("Top Percentage", (new Integer(3)));;
task.setParameterValue("Top Count", (new Integer(5)));
task.validateParameters();
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("F:/report/TopNPercent.html");
options.setOutputFormat("html");
options.setEmbeddable(false);
task.setRenderOption(options);
task.run();
task.close();
}catch(Exception e)
{
System.out.println("excepton : "+e);
}
}
}
but i'm getting the error
"excepton : org.eclipse.birt.core.exception.BirtException: Cant startup the OSGI framework"
Can any one guide me....
Thanks for your help in advance