Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to integrate birt in Zend Ce with the help of Zend JavaBridge without tomcat server?(integrating birt with zend with the help of zend javabridge)
How to integrate birt in Zend Ce with the help of Zend JavaBridge without tomcat server? [message #805070] Thu, 23 February 2012 09:52 Go to next message
justin dominic is currently offline justin dominicFriend
Messages: 3
Registered: February 2012
Junior Member
i have googled to find any implementations of birt integration in zend framework with birt reporting but found none .

i have installed Zend JavaBridge and tested it by running a java program succesfully

has shown in this link below ..

files.zend.com/help/Zend-Server/working_with_the_java_bridge.htm

when i try to run any of the birts sample report

given in the link below ..

files.zend.com/help/Zend-Platform-i5/birt_apis.htm

it shows internal server error

can anyone show me how to run a birt report in zend CE with the help of Zend java bridge using tomcat server is not an option for me .

please help me has anyone implemented it ? Sad
Re: How to integrate birt in Zend Ce with the help of Zend JavaBridge without tomcat server? [message #806287 is a reply to message #805070] Fri, 24 February 2012 19:47 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Justin

If you download the 3.7 runtime you should be able to build a command
line app that runs the reports. Attached is a simple example. To build
the class make sure you have the jars from the runtime
download/reportengine/lib directory in the classpath. Once built you
should be able to call it the same way as the simple Java app. This
sample does a platform startup and shutdown which is generally not a
good idea if you are going to generate a lot of reports. A better
solution is to wrap the Platform startup and report engine creation in a
singleton that starts when you server starts up, then use the engine to
create a new task per request.


import java.util.logging.Level;

import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EXCELRenderOption;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineConstants;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
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.PDFRenderOption;
import org.eclipse.birt.report.engine.api.RenderOption;
import org.eclipse.birt.report.engine.api.impl.RunAndRenderTask;
import org.eclipse.birt.report.engine.api.script.IReportContext;


public class RunAndRenderTaskTest {

public void runReport() throws EngineException
{

RunAndRenderTask task=null;
IReportEngine engine=null;
EngineConfig config = null;

try{
config = new EngineConfig( );
//config.setLogConfig("c:/dwn", Level.SEVERE);
//config.setResourcePath("C:/work/workspaces/3.7.1workspaces/BIRT
Metal/APIs/resources");
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("Reports/testlibrary.rptdesign");
task = (RunAndRenderTask) engine.createRunAndRenderTask(design);
IReportContext irc = task.getReportContext();
//task.setParameterValue("Top Count", (new Integer(5)));
//task.validateParameters();


//HTMLRenderOption options = new HTMLRenderOption();
//options.setImageDirectory("./");
//options.setOutputFileName("output/resample/external.html");
//options.setOutputFormat("html");
//options.setEmbeddable(false);
//options.setEnableMetadata(true);
//options.setEnableInlineStyle(false);
//options.setEnableAgentStyleEngine(true);
//options.setEnableCompactMode(true);

//PDFRenderOption options = new PDFRenderOption();
//options.setOutputFileName("output/resample/hidefooter.pdf");
//options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
//options.setOutputFormat("pdf");

//EXCELRenderOption options = new EXCELRenderOption();
//options.setOutputFormat("xls");
//options.setOutputFileName("output/resample/customers.xls");
//options.setWrappingText(true);

HTMLRenderOption options = new HTMLRenderOption();
//options.setImageHandler(new HTMLServerImageHandler());
options.setSupportedImageFormats("JPG;PNG;BMP;SVG;GIF");
options.setOutputFileName("output/resample/testlibrary.html");
options.setOutputFormat("html");
//options.setOutputFormat("ppt");



task.setRenderOption(options);
task.run();

irc = task.getReportContext();

task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
}
Platform.shutdown( );
System.out.println("Finished");



}


/**
* @param args
*/
public static void main(String[] args) {
try
{

RunAndRenderTaskTest ex = new RunAndRenderTaskTest( );
ex.runReport();

System.exit(0);

}
catch ( Exception e )
{
e.printStackTrace();
}
}
}

Jason





On 2/23/2012 4:52 AM, justin dominic wrote:
> i have googled to find any implementations of birt integration in zend
> framework with birt reporting but found none .
>
> i have installed Zend JavaBridge and tested it by running a java program
> succesfully
>
> has shown in this link below ..
>
> files.zend.com/help/Zend-Server/working_with_the_java_bridge.htm
>
> when i try to run any of the birts sample report
>
> given in the link below ..
>
> files.zend.com/help/Zend-Platform-i5/birt_apis.htm
>
> it shows internal server error
>
> can anyone show me how to run a birt report in zend CE with the help of
> Zend java bridge using tomcat server is not an option for me .
>
> please help me has anyone implemented it ? :(
Re: How to integrate birt in Zend Ce with the help of Zend JavaBridge without tomcat server? [message #807891 is a reply to message #806287] Mon, 27 February 2012 05:57 Go to previous message
justin dominic is currently offline justin dominicFriend
Messages: 3
Registered: February 2012
Junior Member
Thanks for your reply jason i will surely try it ... Smile
Previous Topic:Add font to BirtViewerApp
Next Topic:how to create tree table in bird
Goto Forum:
  


Current Time: Thu Dec 18 23:58:58 GMT 2014

Powered by FUDForum. Page generated in 0.02100 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software