Hi There,
I have a jasper report (test001.jrxml ) which i want to convert to test001.ppt format, but i am getting below excetption.
Exception in thread "main" java.lang.NoSuchMethodError: com.aspose.slides.jasperreports.JRPptExporter.resetExportContext()V
at com.aspose.slides.jasperreports.JRPptExporter.exportReport(SourceFile:202)
at test.ExportReportToPPT.main(ExportReportToPPT.java:72)
The class i wrote is as below
public class ExportReportToPPT {
public static void main(String[] args) {
// TODO Auto-generated method stub
File sourceFile = new File("C:\\samplerpt\\test001.jrxml");
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("urlstring","username","pwd");
System.out.println("Connection :::::"+conn);
FileInputStream ins=new FileInputStream(sourceFile);
System.out.println(":::::::::::: FileInputStream :::::::::::"+ins);
// ************** Creating Jasper-Printer Object *************
// Map parameters = new HashMap();
// parameters.put("report", "Manmath");
JasperDesign jasperDesign = JRXmlLoader.load ("C:/samplerpt/adrreportsample.jrxml");
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, conn);
//*************** Exporting to PPT file******************
//------------------------------------------------------------------------------------
JRPptExporter exporter = new JRPptExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "C:/samplerpt/test001.ppt");
exporter.exportReport();
//------------------------------------------------------------------------------------
System.out.println("!!!!!!!!!!!!!Export Successfull!!!!!!!!!!!!!");
} catch (JRException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
Thanking you for your help in advance
Tushar