- This topic has 2 replies, 1 voice, and was last updated 17 years, 6 months ago by shanmugam.palani.
-
AuthorPosts
-
shanmugam.palaniMemberHi,
I’ve RAD7001 on my machine and WPS601 on my machine, OSGi framework can’t started
I have used the following coding
The Following code only used in RAD 7.0 (Without using WPS6.0)
/**
*
* TODO To change the template for this generated type comment go to
* Window – Preferences – Java – Code Style – Code Templates
*/import java.io.OutputStream;
import java.util.Collection;
import java.util.Iterator;
import java.io.IOException;import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLCompleteImageHandler;
import org.eclipse.birt.report.engine.api.HTMLEmitterConfig;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask;
import org.eclipse.birt.report.engine.api.IParameterDefnBase;
import org.eclipse.birt.report.engine.api.IParameterGroupDefn;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
import org.eclipse.birt.report.engine.api.IScalarParameterDefn;
import org.eclipse.birt.report.engine.api.ReportEngine;import org.eclipse.birt.report.engine.api.RenderOptionBase;
public class Pdf_Html
{public static boolean RunReport(String ReportPath, String EngineHome, int type)
{// String name = “D:\\iCAST\\resources\\BReports\\ict_rpt_airpadtodp.rptdesign”; // report path and name.
System.out.println(” —————— Checking ——-started——– “);
String format = null;
if(type == 0)
{
format = RenderOptionBase.OUTPUT_FORMAT_PDF; // output as a PDF
}
else
{
format = HTMLRenderOption.OUTPUT_FORMAT_HTML; // output as HTML
}// The EngineConfig is used to set up engine-wide configuration
// information.EngineConfig config = new EngineConfig();
// The Engine home is the location of the Birt engine runtime.
// M3 Note: Use the report engine installed as part of the Birt web app // used to preview reports.System.out.println(” —————— Checking —EngineHome———— “+EngineHome);
config.setEngineHome(EngineHome); // “D:\\birt-runtime-2_1_0\\birt-runtime-2_1_0\\ReportEngine”;// Create the report engine itself. This engine can be used to run
// multiple reports.ReportEngine engine = new ReportEngine( config );
// Open the report design.
IReportRunnable report = null;
try
{
report = engine.openReportDesign( ReportPath ); // ReportPath = “D:\\iCAST\\resources\\BReports\\ict_rpt_airpadtodp.rptdesign”;
System.out.println(” —————— Checking ————— ” + report);
}
catch(EngineException ee)
{
System.err.println(“Report ” + ReportPath + ” not found!\n”);
engine.destroy();
return false;
}// Create a task to run the report and convert the output to PDF.
IRunAndRenderTask task = engine.createRunAndRenderTask( report );
RenderOptionBase options = new RenderOptionBase(); //HTMLRednderOptionoptions.setOutputFormat(format);
String output = ReportPath.replaceFirst( “.rptdesign”, “.” + format );
options.setOutputFileName(output);
task.setRenderOption(options);// Run the report.
try
{
task.run();
}
catch(EngineException e1)
{
System.err.println(“Report test.html run failed”);
}
engine.destroy(); // Clean up report.
return true;
}public static void main(String[] args) {
int type = 0;String ReportPath = “D:\\Demo\\resources\\BReports\\ict_rpt_airpadtodp.rptdesign”; // report path and name.
String EnginePath = “D:\\birt-runtime-2_1_0\\birt-runtime-2_1_0\\ReportEngine”;
// String EnginePath = “D:\\IBM\\rationalsdp7.0\\workspace02\\RptModule\\WebContent\\WEB-INF\\platform”;boolean hold = RunReport(ReportPath, EnginePath, type);
}}
I got the exceptions as given below:
Exception in thread “main” java.lang.NoSuchMethodError: org.eclipse.emf.common.util.AbstractEnumerator: method <init>(ILjava/lang/String;Ljava/lang/String;)V not found
at org.eclipse.birt.chart.model.attribute.Position.<init>(Position.java:285)
at org.eclipse.birt.chart.model.attribute.Position.<clinit>(Position.java:114)
at org.eclipse.birt.chart.reportitem.ChartReportItemImpl.<clinit>(ChartReportItemImpl.java:78)
at org.eclipse.birt.chart.reportitem.ChartReportItemFactoryImpl.newReportItem(ChartReportItemFactoryImpl.java:47)
at org.eclipse.birt.report.model.extension.PeerExtensibilityProvider.initializeReportItem(PeerExtensibilityProvider.java:384)
at org.eclipse.birt.report.model.elements.ExtendedItem.initializeReportItem(ExtendedItem.java:293)
at org.eclipse.birt.report.model.api.validators.ExtensionValidator.doValidate(ExtensionValidator.java:95)
at org.eclipse.birt.report.model.api.validators.ExtensionValidator.validate(ExtensionValidator.java:76)
at org.eclipse.birt.report.model.validators.ValidationNode.perform(ValidationNode.java:133)
at org.eclipse.birt.report.model.validators.ValidationExecutor.perform(ValidationExecutor.java:76)
at org.eclipse.birt.report.model.core.DesignElement.validateWithContents(DesignElement.java:2243)
at org.eclipse.birt.report.model.core.DesignElement.validateWithContents(DesignElement.java:2252)
at org.eclipse.birt.report.model.core.Module.semanticCheck(Module.java:1310)
at org.eclipse.birt.report.model.parser.ModuleParserHandler.endDocument(ModuleParserHandler.java:237)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(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:93)
at org.eclipse.birt.report.model.parser.ModuleReader.readModule(ModuleReader.java:203)
at org.eclipse.birt.report.model.parser.DesignReader.read(DesignReader.java:135)
at org.eclipse.birt.report.model.core.DesignSession.openDesign(DesignSession.java:208)
at org.eclipse.birt.report.model.api.SessionHandle.openDesign(SessionHandle.java:173)
at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:133)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:121)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:220)
at org.eclipse.birt.report.engine.api.ReportEngine.openReportDesign(ReportEngine.java:110)
at reportsmodule.Pdf_Html.RunReport(Pdf_Html.java:84)
at reportsmodule.Pdf_Html.main(Pdf_Html.java:138)But The same Code is working in the RAD 6.0. Its working Fine.
Regards,
Shanmugam
(shanmuga_palani@yahoo.com)[/b][/code]
shanmugam.palaniMember@shanmugam.palani wrote:
Hi,
II am eagerly wating for the reply.
shanmugam.palaniMemberHi,
OSGi framework can’t started (RAD 7.0) but its working in RAD 6.0 with WPS 5.1.
-
AuthorPosts