Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to modify, run and render a Report?
How to modify, run and render a Report? [message #157065] Fri, 28 April 2006 11:07 Go to next message
Peter Fopma is currently offline Peter FopmaFriend
Messages: 81
Registered: July 2009
Member
I would like to modify a report prior to sending it the the
report engine to be rendered.

I therefore combined the example to use the DE API and the code
from ReportRunner to solve the task.
The problem i now face is that i cannot include the model.jar in
the classpath since this creates an error when using the report engine.
As i understand it an initalization of the plugin is neccessary for
the engine to be able to run (which is done by the framework).

How can I use the DesignEngine without putting it in the classpath -
or put it another way, how must I load the model plugin correctly?

Thanks for your help
Peter
Re: How to modify, run and render a Report? [message #157201 is a reply to message #157065] Fri, 28 April 2006 15:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Peter,

What version of BIRT are you using?
I did an example with 2.0.1.
I combined the two as well and all I had to do was add the Jars in the
Report Engine folder to my classpath. Attached is the code. Note that I
did not save to a file. I used Buffered Streams, which isn't memory
efficient. Pipes are probably better.

Jason

import java.util.HashMap;
import java.io.*;

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.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
import org.eclipse.birt.report.engine.api.ReportEngine;
import org.eclipse.birt.report.engine.api.EngineConstants;
import org.eclipse.birt.report.model.api.CellHandle;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.DesignEngine;
import org.eclipse.birt.report.model.api.ElementFactory;
import org.eclipse.birt.report.model.api.GridHandle;
import org.eclipse.birt.report.model.api.ImageHandle;
import org.eclipse.birt.report.model.api.LabelHandle;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.api.RowHandle;
import org.eclipse.birt.report.model.api.SessionHandle;
import org.eclipse.birt.report.model.api.TableHandle;

import java.util.logging.Level;

public class ExecuteReportDEAPI {

static void executeReport() throws EngineException {
HashMap parameters = new HashMap();
EngineConfig config = new EngineConfig();
config
.setEngineHome("C:/birt-runtime-2_0_1/birt-runtime-2_0_1/Report
Engine");

try {

// Create a session handle. Use Default Locale
SessionHandle session = DesignEngine.newSession(null);

// Create a new report design.
ReportDesignHandle design = session.createDesign();

// The element factory creates instances of the various BIRT elements.
ElementFactory factory = design.getElementFactory();

// Create a simple master page
DesignElementHandle element = factory
.newSimpleMasterPage("Page Master");
design.getMasterPages().add(element);

// Create a grid and add it to the "body" slot of the report
// design.
GridHandle grid = factory
.newGridItem(null, 2 /* cols */, 1 /* row */);
design.getBody().add(grid);

TableHandle th = factory.newTableItem("test", 2);

design.getBody().add(th);
th.setWidth("100%");

grid.setWidth("100%");
// Get the first row of grid.
RowHandle row = (RowHandle) grid.getRows().get(0);

// Create an image and add it to the first cell.

ImageHandle image = factory.newImage(null);
CellHandle cell = (CellHandle) row.getCells().get(0);
cell.getContent().add(image);

image.setURI("\"c:/test/CreateReport/images/eclipseconlogo.jpg\ "");

// Create a label and add it to the second cell.

LabelHandle label = factory.newLabel(null);
cell = (CellHandle) row.getCells().get(1);
cell.getContent().add(label);
label.setText("Welcome to EclipseCon!");

// Save the design and close it.

//design.saveAs( "c:/test/CreateReport/EclipseCon.rptdesign" );
ByteArrayOutputStream rout = new ByteArrayOutputStream();
design.serialize(rout);
ByteArrayInputStream rin = new ByteArrayInputStream(rout
.toByteArray());
design.close();
session.closeAll(true);
System.out.println("Finished Report Design!");

//Create the report engine
ReportEngine engine = new ReportEngine(config);
IReportRunnable rptdesign = null;
rptdesign = engine.openReportDesign(rin);

IRunAndRenderTask task = engine.createRunAndRenderTask(rptdesign);

//Set Render context to handle url and image locataions
HTMLRenderContext renderContext = new HTMLRenderContext();
renderContext.setImageDirectory("image");
HashMap contextMap = new HashMap();
contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
renderContext);
task.setAppContext(contextMap);
//task.setParameterValues(parameters);
task.setParameterValue("Top Count", new Integer(12));
task.validateParameters();

//ProcessFilter pf = new ProcessFilter();
//task.addScriptableJavaObject("pFilter", pf);

//Set rendering options - such as file or stream output,
//output format, whether it is embeddable, etc
HTMLRenderOption options = new HTMLRenderOption();
options.setEmbeddable(true);
options.setOutputFileName("c:\\test\\ExecuteReport\\ERDEAPI.html ");
options.setOutputFormat("html");
//options.setHtmlPagination(true);
task.setRenderOption(options);

//run the report and destroy the engine
task.run();
task.close();
engine.destroy();
} catch (Exception e) {
e.printStackTrace();

}
}

/**
* @param args
*/
public static void main(String[] args) {
try {
executeReport();
} catch (Exception e) {
e.printStackTrace();
}
}

}


"Peter Fopma" <peter.fopma@ifb-group.com> wrote in message
news:20a44560e300ac6f1a6cd981bd478132$1@www.eclipse.org...
>I would like to modify a report prior to sending it the the
> report engine to be rendered.
>
> I therefore combined the example to use the DE API and the code
> from ReportRunner to solve the task.
> The problem i now face is that i cannot include the model.jar in
> the classpath since this creates an error when using the report engine.
> As i understand it an initalization of the plugin is neccessary for
> the engine to be able to run (which is done by the framework).
>
> How can I use the DesignEngine without putting it in the classpath -
> or put it another way, how must I load the model plugin correctly?
>
> Thanks for your help
> Peter
>
Re: How to modify, run and render a Report? [message #157233 is a reply to message #157201] Fri, 28 April 2006 19:34 Go to previous messageGo to next message
Peter Fopma is currently offline Peter FopmaFriend
Messages: 81
Registered: July 2009
Member
I now use version 2.1RC1a. In version 2.0.1 it works as you
describe it.
I replaced version 2.0.1 with version 2.1 RC1a and added the file
org.eclipse.birt.report.model_2.1.0.N20060415-1243.jar to the classpath
to access the DesignEngine class.

I use the ReportRunner class as an example with a report design file which
uses a flatfile-datasource.
When running the code I get the following error:

org.eclipse.birt.report.engine.api.EngineException: Missing extenion id in
data source definition, Datenquelle
at
org.eclipse.birt.report.engine.adapter.ModelDteApiAdapter.ne wOdaDataSource(ModelDteApiAdapter.java:297)
at
org.eclipse.birt.report.engine.adapter.ModelDteApiAdapter.cr eateDataSourceDesign(ModelDteApiAdapter.java:178)
...

Removing the model.jar from the class path and running the ReportRunner
again
completes without error.

Debugging the application shows that in the second case the function
ModelPlugin.start(BundelContext) is executed.

Here the function
ODAProviderFactory.initeTheFactory( new ODABaseProviderFactory( ) );
is called which sets the baseFactory for in the ODAProviderFactory class,
which in the first case (when the model.jar is in the classpath) is NULL.

The function ModelPlugin.start and the initeTheFactory function appear
to be called from the framework when the plugin is loaded (please correct
me if I'm wrong).

Actually it is not neccessary to use the DesignEngine. The problem results
from having the jar-file in the classpath!?

Thanks for your help
Peter Fopma
Re: How to modify, run and render a Report? [message #157361 is a reply to message #157233] Sun, 30 April 2006 20:08 Go to previous messageGo to next message
Peter Fopma is currently offline Peter FopmaFriend
Messages: 81
Registered: July 2009
Member
Dear Jason,

I tried to run your sample code under version 2.1 RC1a and the same
problem appears as with my own code. It fails with the exception:

java.lang.NoClassDefFoundError: org/eclipse/birt/core/script/BirtHashMap
at
org.eclipse.birt.report.engine.executor.ExecutionContext.<init >(ExecutionContext.java:146)
at
org.eclipse.birt.report.engine.api.impl.EngineTask.<init>(EngineTask.java:119)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.<init >(RunAndRenderTask.java:53)
at
org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.c reateRunAndRenderTask(ReportEngineHelper.java:216)
at
org.eclipse.birt.report.engine.api.impl.ReportEngine.createR unAndRenderTask(ReportEngine.java:257)
at
org.eclipse.birt.report.engine.api.ReportEngine.createRunAnd RenderTask(ReportEngine.java:148)
at ExecuteReportDEAPI.executeReport(ExecuteReportDEAPI.java:98)
at ExecuteReportDEAPI.main(ExecuteReportDEAPI.java:138)
Exception in thread "main"

When adding the org.eclipse.birt.core.jar to the classpath the following
happens: the class Platform in org.eclipse.birt.core has a function
startup()
which starts the OSGI Framework. launcher.startup(context) should
load the core plugin and afterwards the platform variable should be
set. This is not the case and the code later fails with a NULL-Pointer
exception.

Any idea how this can be resolved?

Thanks
Peter
Re: How to modify, run and render a Report? [message #157395 is a reply to message #157361] Mon, 01 May 2006 14:37 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Peter,

The example I posted will not work it RC1a. It should work in RC2 when it
is available.
I am attaching an example of the executing a report that should work with
RC1a, but the DEAPI code is not in it.

Jason

import java.util.HashMap;
import java.io.*;

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.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;

import org.eclipse.birt.report.engine.api.EngineConstants;
import java.util.logging.Level;

import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.core.framework.PlatformFileContext;
import org.eclipse.birt.core.framework.IPlatformContext;


public class ExecuteReport {

static void executeReport() throws EngineException
{
IReportEngine engine;

HashMap parameters = new HashMap();
//Engine Configuration - set and get temp dir, BIRT home, Servlet context
EngineConfig config = new EngineConfig();
//config.setLogConfig("c:/test/ExecuteReport", Level.OFF);
//config.setLogConfig("", Level.OFF);
config.setEngineHome(
"C:/birt-runtime-2.1RC0/birt-runtime-2_1_0/ReportEngine" );


//Create the report engine
//ReportEngine engine = new ReportEngine( config );
IReportRunnable design = null;

try{
IPlatformContext context = new PlatformFileContext( );
Platform.startup( context );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );

// JRE default level is INFO, which may reveal too much internal
// logging
// information.
engine.changeLogLevel( Level.FINEST );



//Open a report design - use design to modify design, retrieve embedded
images etc.
FileInputStream fs = new
FileInputStream("C:/test/2.1/ExecuteReport/SimpleListing.rptdesign ");
design = engine.openReportDesign(fs);

//IReportRunnable design =
engine.openReportDesign("C:/test/ExecuteReport/TopNPercent.rptdesign ");

//Create task to run the report - use the task to execute and run the
report,
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
//config.setTempDir("c:/work/test/tmp");

//Set Render context to handle url and image locataions
HTMLRenderContext renderContext = new HTMLRenderContext();
renderContext.setImageDirectory("image");
HashMap contextMap = new HashMap();
contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
renderContext );
task.setAppContext( contextMap );
//task.setParameterValues(parameters);
task.setParameterValue("Top Count", new Integer(12));
task.validateParameters();

//ProcessFilter pf = new ProcessFilter();
//task.addScriptableJavaObject("pFilter", pf);


//Set rendering options - such as file or stream output,
//output format, whether it is embeddable, etc
HTMLRenderOption options = new HTMLRenderOption();
options.setEmbeddable(true);
options.setOutputFileName("C:/test/2.1/ExecuteReport/SimpleListing.html ");
options.setOutputFormat("html");
//options.setHtmlPagination(true);
task.setRenderOption(options);


//run the report and destroy the engine
task.run();
task.close();

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

}
}
/**
* @param args
*/
public static void main(String[] args) {
try
{
executeReport( );
}
catch ( Exception e )
{
e.printStackTrace();
}
}

}

"Peter Fopma" <peter.fopma@ifb-group.com> wrote in message
news:bba2d9aa9c638fa4804beae41b0951d5$1@www.eclipse.org...
> Dear Jason,
>
> I tried to run your sample code under version 2.1 RC1a and the same
> problem appears as with my own code. It fails with the exception:
>
> java.lang.NoClassDefFoundError: org/eclipse/birt/core/script/BirtHashMap
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.<init >(ExecutionContext.java:146)
> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.<init>(EngineTask.java:119)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.<init >(RunAndRenderTask.java:53)
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.c reateRunAndRenderTask(ReportEngineHelper.java:216)
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngine.createR unAndRenderTask(ReportEngine.java:257)
> at
> org.eclipse.birt.report.engine.api.ReportEngine.createRunAnd RenderTask(ReportEngine.java:148)
> at ExecuteReportDEAPI.executeReport(ExecuteReportDEAPI.java:98)
> at ExecuteReportDEAPI.main(ExecuteReportDEAPI.java:138)
> Exception in thread "main"
>
> When adding the org.eclipse.birt.core.jar to the classpath the following
> happens: the class Platform in org.eclipse.birt.core has a function
> startup()
> which starts the OSGI Framework. launcher.startup(context) should
> load the core plugin and afterwards the platform variable should be
> set. This is not the case and the code later fails with a NULL-Pointer
> exception.
>
> Any idea how this can be resolved?
>
> Thanks
> Peter
>
Re: How to modify, run and render a Report? [message #157558 is a reply to message #157395] Mon, 01 May 2006 19:01 Go to previous messageGo to next message
Peter Fopma is currently offline Peter FopmaFriend
Messages: 81
Registered: July 2009
Member
Jason, thanks for your answer.
Another problem I face, might be related to this... I have a ODA-Datasource
which provides BIRT with data. Part of the plugin code is in the
application
project.
This makes it neccessary that the oda.jar is in the classpath and this
results
in the same problem as we discussed with the model.jar. Try to
use a flatfile datasource, include the oda.jar file in the classpath
and execute the ReportRunner class.
Will this problem also be fixed in the new version RC2? Or will the problem
only be resolved for the design engine.

Thanks
Peter
Re: How to modify, run and render a Report? [message #157589 is a reply to message #157558] Mon, 01 May 2006 20:49 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Peter,
I am not certain this is the same problem. Your app if it is an ODA should
have a runtime reliance on ODA anyways. I just tried executing a report
using the REAPI with a flatfile datasource and didnt have to include
anything related to ODA at design time, just the libs in the RE lib
directory. All I had to do is make sure OSGI loaded up my plugins, by using
the factory to create the engine.

IPlatformContext context = new PlatformFileContext( );
Platform.startup( context );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );

Try this with your example. Note this is 2.1 rc1a and make sure your ODA is
in the plugins directory. Let me know how it goes.

Jason


Here is the code I used


import java.util.HashMap;
import java.io.*;

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.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;

import org.eclipse.birt.report.engine.api.EngineConstants;
import java.util.logging.Level;

import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.core.framework.PlatformFileContext;
import org.eclipse.birt.core.framework.IPlatformContext;


public class ExecuteReport {

static void executeReport() throws EngineException
{
IReportEngine engine;

HashMap parameters = new HashMap();
//Engine Configuration - set and get temp dir, BIRT home, Servlet context
EngineConfig config = new EngineConfig();
//config.setLogConfig("c:/test/ExecuteReport", Level.OFF);
//config.setLogConfig("", Level.OFF);
config.setEngineHome(
"C:/birt-runtime-2.1RC0/birt-runtime-2_1_0/ReportEngine" );


//Create the report engine
//ReportEngine engine = new ReportEngine( config );
IReportRunnable design = null;

try{
IPlatformContext context = new PlatformFileContext( );
Platform.startup( context );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );

// JRE default level is INFO, which may reveal too much internal
// logging
// information.
engine.changeLogLevel( Level.FINEST );



//Open a report design - use design to modify design, retrieve embedded
images etc.
FileInputStream fs = new
FileInputStream("C:/test/2.1/ExecuteReport/flatfile.rptdesign ");
design = engine.openReportDesign(fs);

//IReportRunnable design =
engine.openReportDesign("C:/test/ExecuteReport/TopNPercent.rptdesign ");

//Create task to run the report - use the task to execute and run the
report,
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
//config.setTempDir("c:/work/test/tmp");

//Set Render context to handle url and image locataions
HTMLRenderContext renderContext = new HTMLRenderContext();
renderContext.setImageDirectory("image");
HashMap contextMap = new HashMap();
contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
renderContext );
task.setAppContext( contextMap );
//task.setParameterValues(parameters);
task.setParameterValue("Top Count", new Integer(12));
task.validateParameters();

//ProcessFilter pf = new ProcessFilter();
//task.addScriptableJavaObject("pFilter", pf);


//Set rendering options - such as file or stream output,
//output format, whether it is embeddable, etc
HTMLRenderOption options = new HTMLRenderOption();
options.setEmbeddable(true);
options.setOutputFileName("C:/test/2.1/ExecuteReport/flatfile.html ");
options.setOutputFormat("html");
//options.setHtmlPagination(true);
task.setRenderOption(options);


//run the report and destroy the engine
task.run();
task.close();

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

}
}
/**
* @param args
*/
public static void main(String[] args) {
try
{
executeReport( );
}
catch ( Exception e )
{
e.printStackTrace();
}
}

}

"Peter Fopma" <peter.fopma@ifb-group.com> wrote in message
news:37ab3ac909777a89a8296bf9a33c57eb$1@www.eclipse.org...
> Jason, thanks for your answer.
> Another problem I face, might be related to this... I have a
> ODA-Datasource
> which provides BIRT with data. Part of the plugin code is in the
> application
> project.
> This makes it neccessary that the oda.jar is in the classpath and this
> results
> in the same problem as we discussed with the model.jar. Try to
> use a flatfile datasource, include the oda.jar file in the classpath
> and execute the ReportRunner class.
> Will this problem also be fixed in the new version RC2? Or will the
> problem
> only be resolved for the design engine.
>
> Thanks
> Peter
>
>
Re: How to modify, run and render a Report? [message #157605 is a reply to message #157589] Mon, 01 May 2006 21:40 Go to previous messageGo to next message
Peter Fopma is currently offline Peter FopmaFriend
Messages: 81
Registered: July 2009
Member
Sorry, I didn't make myself clear. The code you explained works fine.
Part of my application is the base for the ODA plugin. Therefore I have
for example a class which implement the IResultSet interface. To do
this I must import org.eclipse.datatools.connectivity.oda.IResultSet
which is in the oda.jar.

When this file is in the class path I get this exception:

java.lang.NoClassDefFoundError:
org/eclipse/core/runtime/IConfigurationElement
at
org.eclipse.birt.data.oda.util.manifest.DtpManifestExplorer. getInstance(DtpManifestExplorer.java:56)
at
org.eclipse.birt.report.model.plugin.ODAManifestUtil.getData SourceExtension(ODAManifestUtil.java:41)
at
org.eclipse.birt.report.model.plugin.OdaExtensibilityProvide r.isValidODADataSourceExtensionID(OdaExtensibilityProvider.j ava:201)
at
org.eclipse.birt.report.model.parser.OdaDataSourceState.pars eODADataSourceExtensionID(OdaDataSourceState.java:107)
at
org.eclipse.birt.report.model.parser.OdaDataSourceState.pars eAttrs(OdaDataSourceState.java:53)
at
org.eclipse.birt.report.model.parser.ModuleParserHandler.sta rtElement(ModuleParserHandler.java:159)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unk nown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanSt artElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at
org.eclipse.birt.report.model.parser.ModuleReader.readModule (ModuleReader.java:89)
at
org.eclipse.birt.report.model.parser.ModuleReader.readModule (ModuleReader.java:171)
at
org.eclipse.birt.report.model.parser.DesignReader.read(Desig nReader.java:135)
at
org.eclipse.birt.report.model.core.DesignSession.openDesign( DesignSession.java:179)
at
org.eclipse.birt.report.model.api.SessionHandle.openDesign(S essionHandle.java:151)
at
org.eclipse.birt.report.engine.parser.ReportParser.getDesign Handle(ReportParser.java:93)
at
org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDesign(ReportEngineHelper.java:104)
at
org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDesign(ReportEngine.java:218)
at
org.eclipse.birt.report.engine.api.ReportRunner.runAndRender Report(ReportRunner.java:192)
at
org.eclipse.birt.report.engine.api.ReportRunner.execute(Repo rtRunner.java:165)
at
org.eclipse.birt.report.engine.api.ReportRunner.main(ReportR unner.java:120)
Exception in thread "main"

If this is another issue I should remove the ODA-dependencies from the
application class into the plugin by implementing something like a proxy
in the plugin - but I would like to avoid the effort.

Thanks for your help
Peter
Re: How to modify, run and render a Report? [message #157815 is a reply to message #157605] Tue, 02 May 2006 16:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Peter,

Can you seperate your ODA project piece and buid it and then deploy it to
the plugins directory under the Report Engine plugins directory? Then your
application could use it without any design time issues.

Jason

"Peter Fopma" <peter.fopma@ifb-group.com> wrote in message
news:0ed60c06dc45629d894127b56c69edd7$1@www.eclipse.org...
> Sorry, I didn't make myself clear. The code you explained works fine.
> Part of my application is the base for the ODA plugin. Therefore I have
> for example a class which implement the IResultSet interface. To do
> this I must import org.eclipse.datatools.connectivity.oda.IResultSet
> which is in the oda.jar.
>
> When this file is in the class path I get this exception:
>
> java.lang.NoClassDefFoundError:
> org/eclipse/core/runtime/IConfigurationElement
> at
> org.eclipse.birt.data.oda.util.manifest.DtpManifestExplorer. getInstance(DtpManifestExplorer.java:56)
> at
> org.eclipse.birt.report.model.plugin.ODAManifestUtil.getData SourceExtension(ODAManifestUtil.java:41)
> at
> org.eclipse.birt.report.model.plugin.OdaExtensibilityProvide r.isValidODADataSourceExtensionID(OdaExtensibilityProvider.j ava:201)
> at
> org.eclipse.birt.report.model.parser.OdaDataSourceState.pars eODADataSourceExtensionID(OdaDataSourceState.java:107)
> at
> org.eclipse.birt.report.model.parser.OdaDataSourceState.pars eAttrs(OdaDataSourceState.java:53)
> at
> org.eclipse.birt.report.model.parser.ModuleParserHandler.sta rtElement(ModuleParserHandler.java:159)
> at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unk nown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanSt artElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at
> org.eclipse.birt.report.model.parser.ModuleReader.readModule (ModuleReader.java:89)
> at
> org.eclipse.birt.report.model.parser.ModuleReader.readModule (ModuleReader.java:171)
> at
> org.eclipse.birt.report.model.parser.DesignReader.read(Desig nReader.java:135)
> at
> org.eclipse.birt.report.model.core.DesignSession.openDesign( DesignSession.java:179)
> at
> org.eclipse.birt.report.model.api.SessionHandle.openDesign(S essionHandle.java:151)
> at
> org.eclipse.birt.report.engine.parser.ReportParser.getDesign Handle(ReportParser.java:93)
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.o penReportDesign(ReportEngineHelper.java:104)
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngine.openRep ortDesign(ReportEngine.java:218)
> at
> org.eclipse.birt.report.engine.api.ReportRunner.runAndRender Report(ReportRunner.java:192)
> at
> org.eclipse.birt.report.engine.api.ReportRunner.execute(Repo rtRunner.java:165)
> at
> org.eclipse.birt.report.engine.api.ReportRunner.main(ReportR unner.java:120)
> Exception in thread "main"
> If this is another issue I should remove the ODA-dependencies from the
> application class into the plugin by implementing something like a proxy
> in the plugin - but I would like to avoid the effort.
>
> Thanks for your help
> Peter
>
Re: How to modify, run and render a Report? [message #158796 is a reply to message #157815] Fri, 05 May 2006 15:55 Go to previous message
Peter Fopma is currently offline Peter FopmaFriend
Messages: 81
Registered: July 2009
Member
Jason, I tried the new version (RC2) and using the flatfile plugin now
works
when using the design engine and the report engine.
But my own plugin can no longer be found. When trying to run a report with
my own datasource it fails with the exception below.

java.lang.IllegalArgumentException: The extension with ID
'org.eclipse.birt.report.data.oda.ifbbirtplugin' is not found!
at
org.eclipse.birt.report.model.plugin.ODAManifestUtil.getData SourceExtension(ODAManifestUtil.java:50)
at
org.eclipse.birt.report.model.plugin.OdaExtensibilityProvide r.isValidODADataSourceExtensionID(OdaExtensibilityProvider.j ava:201)
at
org.eclipse.birt.report.model.parser.OdaDataSourceState.pars eODADataSourceExtensionID(OdaDataSourceState.java:125)
at
org.eclipse.birt.report.model.parser.OdaDataSourceState.pars eAttrs(OdaDataSourceState.java:65)
at
org.eclipse.birt.report.model.parser.ModuleParserHandler.sta rtElement(ModuleParserHandler.java:159)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unk nown
Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyEle ment(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanSt artElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at
org.eclipse.birt.report.model.parser.ModuleReader.readModule (ModuleReader.java:89)
at
org.eclipse.birt.report.model.parser.ModuleReader.readModule (ModuleReader.java:171)
at
org.eclipse.birt.report.model.parser.DesignReader.read(Desig nReader.java:135)
at
org.eclipse.birt.report.model.core.DesignSession.openDesign( DesignSession.java:208)
at
org.eclipse.birt.report.model.api.SessionHandle.openDesign(S essionHandle.java:174)
at
com.ifbag.okular.base.reportgen.CReportGenerator.getReportGe nerator(CReportGenerator.java:115)
at com.ifbag.okular.base.reportgen.CReportTest.main(CReportTest .java:49)

From the OSGI-framework I first got the error that the MANIFEST.MF file for
the plugin could not be found. I then created the file with the following
content listed below.

Could you give me a hint on what the problem could be?

Thanks
Peter


Bundle-SymbolicName: org.eclipse.birt.report.data.oda.ifbbirtplugin;
singleton=true
Bundle-Version: 1.0.0
Bundle-Name: ifb BIRT Plugin
Bundle-Vendor: ifb AG
Require-Bundle: org.eclipse.datatools.connectivity.oda,
org.eclipse.birt.core,
org.eclipse.jdt.core,
org.eclipse.core.resources
Bundle-ClassPath:
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/commons-collections-3.1.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/commons-dbcp-1.2.1.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/commons-pool-1.2.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/db2java.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/eigenbase-properties.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/eigenbase-resgen.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/eigenbase-xom.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/ifbfagbase.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/javacup.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/log4j-1.2.8.jar,
lib/birt/plugins/org.eclipse.birt.report.data.oda.ifbbirtplu gin/lib/mondrian.jar
Bundle-Activator:
org.eclipse.birt.report.data.oda.ifbbirtplugin.plugin.IfbBir tPlugin
Previous Topic:ReportEngine
Next Topic:Integrating Birt into RCP
Goto Forum:
  


Current Time: Sat Aug 17 06:19:08 GMT 2024

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

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

Back to the top