Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT basics(Issue on charts)
BIRT basics [message #780466] Wed, 18 January 2012 07:22 Go to next message
Guru Prasad is currently offline Guru PrasadFriend
Messages: 2
Registered: January 2012
Junior Member
Hi,

I am new bee to BIRT.

Please provide links to have BIRT simple examples.

I am facing problems on creation of charts in my report.
Re: BIRT basics [message #780608 is a reply to message #780466] Wed, 18 January 2012 18:32 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Have you seen these:
http://www.eclipse.org/birt/phoenix/examples/reports/

They are a bit older but should be useful. Birt Exchange also has a lot
of example in the dev share.

Jason

On 1/18/2012 2:22 AM, Guru Prasad wrote:
> Hi,
>
> I am new bee to BIRT.
>
> Please provide links to have BIRT simple examples.
>
> I am facing problems on creation of charts in my report.
Re: BIRT basics [message #786461 is a reply to message #780608] Mon, 30 January 2012 13:10 Go to previous messageGo to next message
Guru Prasad is currently offline Guru PrasadFriend
Messages: 2
Registered: January 2012
Junior Member
I have written some java code to generate report using Birt libraries

package com.report.test;

import java.util.HashMap;
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.HTMLRenderContext;
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.IRunTask;

public class RunTask {

public static void main( String[] args )
{

EngineConfig config = null;
IReportEngine engine = null;
IRunTask task = null;
//Open a report design
try{
config = new EngineConfig( );
//delete the following line if using BIRT 3.7 or later
config.setEngineHome( "C:/birt-runtime-3_7_1/birt-runtime-3_7_1/ReportEngine" );
config.setLogConfig("C:/birt-runtime-3_7_1", Level.FINE);

Platform.startup( config ); //If using RE API in Eclipse/RCP application this is not needed.
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
engine.changeLogLevel( Level.WARNING );


IReportRunnable design = engine.openReportDesign("C:/birt-runtime-3_7_1/birt-runtime-3_7_1/ReportEngine/samples/hello_world.rptdesign");
//Create task to run the report - use the task to execute the report and save to disk.
task = engine.createRunTask(design);

//Set parent classloader for engine
//task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, RunTaskExample.class.getClassLoader());

//run the report and destroy the engine
task.run("C:/birt-runtime-3_7_1/birt-runtime-3_7_1/ReportEngine/samples/hello_world.rptdesign");

task.close();
engine.destroy();
Platform.shutdown();

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

}
}


if I run this ,
org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:81)
at com.report.test.RunTask.main(RunTask.java:32)
Caused by: java.lang.SecurityException: class "org.eclipse.core.runtime.IAdapterManager"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(Unknown Source)
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.birt.core.framework.jar.ServiceLauncher.startup(ServiceLauncher.java:45)
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:75)
... 1 more


Please find attachment for libraries i'm using.

Re: BIRT basics [message #786663 is a reply to message #786461] Mon, 30 January 2012 17:28 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Do you have the birt runtime libs in your classpath/buildpath?
Remove this line:
config.setEngineHome(
"C:/birt-runtime-3_7_1/birt-runtime-3_7_1/ReportEngine" );

Jason


On 1/30/2012 8:10 AM, Guru Prasad wrote:
> I have written some java code to generate report using Birt libraries
>
> package com.report.test;
>
> import java.util.HashMap;
> 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.HTMLRenderContext;
> 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.IRunTask;
>
> public class RunTask {
>
> public static void main( String[] args )
> {
>
> EngineConfig config = null;
> IReportEngine engine = null;
> IRunTask task = null;
> //Open a report design
> try{
> config = new EngineConfig( );
> //delete the following line if using BIRT 3.7 or later
> config.setEngineHome( "C:/birt-runtime-3_7_1/birt-runtime-3_7_1/ReportEngine" );
> config.setLogConfig("C:/birt-runtime-3_7_1", Level.FINE);
>
> Platform.startup( config ); //If using RE API in Eclipse/RCP application this is not needed.
> IReportEngineFactory factory = (IReportEngineFactory) Platform
> .createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
> engine = factory.createReportEngine( config );
> engine.changeLogLevel( Level.WARNING );
>
>
> IReportRunnable design = engine.openReportDesign("C:/birt-runtime-3_7_1/birt-runtime-3_7_1/ReportEngine/samples/hello_world.rptdesign");
> //Create task to run the report - use the task to execute the report and save to disk.
> task = engine.createRunTask(design);
>
> //Set parent classloader for engine
> //task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, RunTaskExample.class.getClassLoader());
>
> //run the report and destroy the engine
> task.run("C:/birt-runtime-3_7_1/birt-runtime-3_7_1/ReportEngine/samples/hello_world.rptdesign");
>
> task.close();
> engine.destroy();
> Platform.shutdown();
>
> }catch( Exception ex){
> ex.printStackTrace();
> }
>
> }
> }
>
>
> if I run this ,
> org.eclipse.birt.core.exception.BirtException: error.CannotStartupOSGIPlatform
> at org.eclipse.birt.core.framework.Platform.startup(Platform.java:81)
> at com.report.test.RunTask.main(RunTask.java:32)
> Caused by: java.lang.SecurityException: class "org.eclipse.core.runtime.IAdapterManager"'s signer information does not match signer information of other classes in the same package
> at java.lang.ClassLoader.checkCerts(Unknown Source)
> at java.lang.ClassLoader.preDefineClass(Unknown Source)
> at java.lang.ClassLoader.defineClassCond(Unknown Source)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at java.security.SecureClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.access$000(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at org.eclipse.birt.core.framework.jar.ServiceLauncher.startup(ServiceLauncher.java:45)
> at org.eclipse.birt.core.framework.Platform.startup(Platform.java:75)
> ... 1 more
>
>
> Please find attachment for libraries i'm using.
>
>
Previous Topic:Birt Client side scripting
Next Topic:Date Parameter
Goto Forum:
  


Current Time: Wed Apr 24 20:58:40 GMT 2024

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

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

Back to the top