Bonjour,
J'essaye de générer un document Excel on travaillant avec ireport mais j'obtiens le message d'erreur suivant :
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Sheet
Voici le code que j'utilise :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
import java.io.File;
import java.util.HashMap;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.export.JRPdfExporterParameter;
import net.sf.jasperreports.engine.export.JRXlsExporter;
public class Excel {
public static void main(String[] args) throws JRException {
HashMap<String, Object> params = new HashMap<String, Object>();
// ...
// Renseignment des paramètres
// ...
//Remplissage du rapport
JasperPrint jasperPrint = JasperFillManager.fillReport("D:\\iReport-2.0.3\\iReport-2.0.jasper", params,
new JREmptyDataSource());
// export en xls
JRXlsExporter excelExporter = new JRXlsExporter();
excelExporter.setParameter(JRPdfExporterParameter.JASPER_PRINT,jasperPrint);
excelExporter.setParameter(JRPdfExporterParameter.OUTPUT_FILE, new File("E:\\rapport.xls"));
excelExporter.exportReport();
}} |
Merci d'avance
Partager