Jump to content
Changes to the Jaspersoft community edition download ×

XLS Export error in app. Export to file?


2005 IR Help

Recommended Posts

By: GodSend - godsend25

XLS Export error in app. Export to file?

2004-03-11 11:44

Im trying to export directly to a file using a simple jFileChooser and I get the following error :

 

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFSheet.createRow(S

)Lorg/apache/poi/hssf/usermodel/HSSFRow;

at dori.jasper.engine.export.JRXlsExporter.exportPage(JRXlsExporter.java

:377)

at dori.jasper.engine.export.JRXlsExporter.exportReportToStream(JRXlsExp

orter.java:305)

at dori.jasper.engine.export.JRXlsExporter.exportReport(JRXlsExporter.ja

va:248)

 

 

I am using the following code :

 

JasperDesign jasperDesign = JasperManager.loadXmlDesign("remarks.xml");

JasperReport jasperReport = JasperManager.compileReport(jasperDesign);

 

Map parameters = new HashMap();

parameters.put("Title", "Remarks for " + d_.toString());

parameters.put("id", d_.getMarkelId());

parameters.put("name",d_.toString());

parameters.put("start", startDate.getText());

parameters.put("end",endDate.getText());

 

JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, parameters, McArthurDriverManager.dbConnections.con_markel);

 

 

JFileChooser chooser = new JFileChooser();

chooser.setDialogType(JFileChooser.SAVE_DIALOG);

ExampleFileFilter filter = new ExampleFileFilter();

filter.addExtension("xls");

filter.setDescription("Excel Worksheet");

chooser.setFileFilter(filter);

int returnVal = chooser.showSaveDialog(McArthurDriverManager.root);

if(returnVal == JFileChooser.APPROVE_OPTION) {

File destFile = new File(chooser.getSelectedFile().toString());

JRXlsExporter exporter = new JRXlsExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

//exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, destFile.toString());

exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

exporter.setParameter(JRExporterParameter.OUTPUT_FILE, destFile);

exporter.exportReport();

}

 

 

Any Ideas guys? I tried replacing JRExporterParameter.OUTPUT_FILE, destFile with

JRExporterParameter.OUTPUT_STREAM, destFile.toString() and had no luck :(

 

 

 

 

By: Gregory A. Swarthout - gswarthout

RE: XLS Export error in app. Export to file?

2004-03-11 12:01

Sounds like the wrong version of POI

 

 

 

 

By: GodSend - godsend25

RE: XLS Export error in app. Export to file?

2004-03-11 16:01

aNY IDEA which version I should be using ? :) This was the latest and greatest from jakarta today..

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...