Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » [Resolved] Generate pdf/html with rptdesign
[Resolved] Generate pdf/html with rptdesign [message #1694552] Wed, 06 May 2015 09:10 Go to next message
tulfier tulifer is currently offline tulfier tuliferFriend
Messages: 4
Registered: May 2015
Junior Member
Hello guys,

I am sorry if i don't wrote in a good english.

I want generate pdf/html repport with my rptdesign.
When i generate pdf/html in eclipse or with the runtime on my server jboss it's work fine i have my repport.

But when i want generate with javacode don't work.

I use the code on www.actuate.com.
The rptDesign is build with Birt 4.2.2 and the Runtime is 4.2.2

This is the error.

Quote:

mai 06, 2015 10:56:04 AM org.eclipse.birt.data.engine.odaconsumer.Connection getMaxQueries
PLUS PRÉCIS: RETURN 0
mai 06, 2015 10:56:04 AM org.eclipse.birt.data.engine.impl.ParameterUtil ParameterUtil
PLUS PRÉCIS: ENTRY null org.eclipse.birt.data.engine.impl.OdaDataSetRuntime@14e18a1 org.eclipse.birt.data.engine.api.querydefn.QueryDefinition@1d414c5 [object Object]
mai 06, 2015 10:56:04 AM org.eclipse.birt.data.engine.impl.ParameterUtil ParameterUtil
PLUS PRÉCIS: RETURN
mai 06, 2015 10:56:04 AM org.eclipse.birt.data.engine.impl.ParameterUtil ParameterUtil
PLUS PRÉCIS: ENTRY null org.eclipse.birt.data.engine.impl.OdaDataSetRuntime@14e18a1 org.eclipse.birt.data.engine.api.querydefn.QueryDefinition@1d414c5 [object Object]
mai 06, 2015 10:56:04 AM org.eclipse.birt.data.engine.impl.ParameterUtil ParameterUtil
PLUS PRÉCIS: RETURN
mai 06, 2015 10:56:04 AM org.eclipse.birt.report.engine.api.impl.EngineTask handleFatalExceptions
GRAVE: Error happened while running the report.
java.lang.NoSuchMethodError: org.eclipse.datatools.connectivity.oda.spec.QuerySpecification.getBaseQuery()Lorg/eclipse/datatools/connectivity/oda/spec/BaseQuery;
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:284)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:517)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:346)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:463)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:178)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:637)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:152)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:275)
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1947)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:181)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at Edition2.executeReport(Edition2.java:58)
at Edition2.main(Edition2.java:16)


The code

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.PDFRenderOption;
import org.eclipse.birt.report.model.elements.olap.Level;

public class Edition2 {
	public static void main(String[] args) {
		 try
		 {
		  executeReport( );
		 }
		 catch ( Exception e )
		 {
		  e.printStackTrace();
		 }
		}

static void executeReport() throws EngineException
{

IReportEngine engine=null;
EngineConfig config = null;

try{
	config = new EngineConfig( );			
	config.setBIRTHome("C:\\Documents and Settings\\__\\Mes documents\\Dev\\Programmes\\Runtime BIRT\\4_2_2\\ReportEngine");
	config.setLogConfig(".\\logs", java.util.logging.Level.FINEST);
	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("new_report_1.rptdesign"); 
	IRunAndRenderTask task = engine.createRunAndRenderTask(design); 		
	task.setParameterValue("ordParam", (new Integer(10101)));
	task.validateParameters();
			
	HTMLRenderOption options = new HTMLRenderOption();		
	options.setOutputFileName("output/report.html");
	options.setOutputFormat("html");
	options.setHtmlRtLFlag(false);
	options.setEmbeddable(false);
	//options.setImageDirectory("C:\\test\\images");

//	PDFRenderOption options = new PDFRenderOption();
//	options.setOutputFileName("test.pdf");
//	options.setOutputFormat("pdf");

	task.setRenderOption(options);
	task.run();
	task.close();
	engine.destroy();
}catch( Exception ex){
	ex.printStackTrace();
}		
finally
{
       Platform.shutdown( );
}

}}



Thanks for your response and good day Wink

[Updated on: Wed, 06 May 2015 21:28]

Report message to a moderator

Re: Generate pdf/html with rptdesign [message #1694655 is a reply to message #1694552] Wed, 06 May 2015 21:27 Go to previous messageGo to next message
tulfier tulifer is currently offline tulfier tuliferFriend
Messages: 4
Registered: May 2015
Junior Member
Problem resolved.

I delete all my library i download again and bingo that work fine Wink
Re: Generate pdf/html with rptdesign [message #1694766 is a reply to message #1694655] Thu, 07 May 2015 15:57 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Great. Glad it's working. Thanks for updating your thread! Smile

Michael

Developer Evangelist, Silanis
Re: [Resolved] Generate pdf/html with rptdesign [message #1838725 is a reply to message #1694552] Thu, 04 March 2021 07:53 Go to previous message
Xuan Nguyen is currently offline Xuan NguyenFriend
Messages: 1
Registered: March 2021
Junior Member
Hi Bro, I don't know get :
config.setBIRTHome("C:\\Documents and Settings\\__\\Mes documents\\Dev\\Programmes\\Runtime BIRT\\4_2_2\\ReportEngine");

Where are you C:\\Documents and Settings\\__\\Mes documents\\Dev\\Programmes\\Runtime BIRT\\4_2_2\\ReportEngine ? .Pls ,thank
Previous Topic:Birt Sorting
Next Topic:Customize Viewerexception
Goto Forum:
  


Current Time: Thu May 02 09:57:50 GMT 2024

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

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

Back to the top