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)
birt integration
amrutha
Hello friends,
iam making a plugin where i add a actionset to my plugin so whenever i click my menu birt report should be run iam unable to instantiate ReportEngine. the code is not debugging the lines...
Find more posts tagged with
Comments
JasonW
Take a look at the examples in this dev share item.
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/1187-eclipsecon-2010-birt-metal-ppt/
There is an example of running the birt engine in an RCP app. Remember to set birt home to "" and do not do a Platform.startup call.
Jason
amrutha
Hello Jason,
thanks a lot for ur help plz can u tel me hw to set birt home pls
amrutha
Hello Jason ,
is it necessary for me to add the extension point org.eclipse.core.runtime.applications i mean when is this useful ....I am adding actionset so my run and render code is supposed to be in run(IAction action) method right? I ve done wat u said i am not calling platform.start still the code is not running plz help me.whenever i click the action it says not available...Plz tel my mistake
here is my code..
package sample.actions;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import java.util.logging.Level;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
import org.eclipse.birt.report.engine.api.ReportEngine;
public class SampleAction implements IWorkbenchWindowActionDelegate {
public SampleAction()
{
System.out.println("hello");
}
@Override
public void dispose() {
// TODO Auto-generated method stub
}
@Override
public void init(IWorkbenchWindow window) {
// TODO Auto-generated method stub
}
@Override
public void run(IAction action) {
SampleAction d=new SampleAction();
try {
d.previewReport();
} catch (EngineException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void selectionChanged(IAction action, ISelection selection) {
// TODO Auto-generated method stub
}
public void previewReport() throws EngineException{
IReportEngine engine=null;
EngineConfig config = null;
try{
config = new EngineConfig( );
config.setBIRTHome("C:\\birt-runtime-2_6_1\\ReportEngine");
config.setLogConfig("c:/temp/test", Level.FINEST);
//Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
IReportRunnable design = null;
design = engine.openReportDesign("D:\\serveencheckforrep\\report_ins\\unusedfunct.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("C:\\test.html");
options.setOutputFormat("html");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
}
/*finally
{
Platform.shutdown( );
}*/
}
}
amrutha
Hey jason,
i got it dependencies was the problem