[Java] extraire et exporter des données sous excel

lenid Messages postés 2 Date d'inscription jeudi 14 mai 2009 Statut Membre Dernière intervention 17 juin 2009 - 15 juin 2009 à 13:53
cs_MoH008 Messages postés 238 Date d'inscription lundi 2 mars 2009 Statut Membre Dernière intervention 29 septembre 2011 - 17 juin 2009 à 18:05
Bonjour a tous. je travaille sur une  application J2EE dans laquelle je souhaiterai exporter mes données de ma base MySQL vers un fichier Excel. pourez-vous SVP,  me trouver un code pouvant m'aider. merci d'avance.

Toujours présent!

3 réponses

cs_MoH008 Messages postés 238 Date d'inscription lundi 2 mars 2009 Statut Membre Dernière intervention 29 septembre 2011 1
15 juin 2009 à 17:45
Google est ton ami, nous ne fournissons pas de code tout fait

The possible meet the impossible to become the possimpible !!
0
lenid Messages postés 2 Date d'inscription jeudi 14 mai 2009 Statut Membre Dernière intervention 17 juin 2009
17 juin 2009 à 11:39
bonjour a la communauté! j'ai pu trouver un package qui me permet de gerer les extractions et les exportations des données vers un fichier excel, mais malheureusement j'ai un petit soucis avec la methode "addCell". L'ors de la compilation l'erreur suivante s'affiche:"cnnot find symbol symbol: method addCell(jxl.labelCell) Location: InterfaceJxlSheet .J'utilise l'environnement NetBeans et voila le bout de code test que j'utilise:
Merci d'avance à celui qui me filera un coup de main pour le debuguer
import java.io.*;
import jxl.*;
import jxl.write.*;

public class FichierExcel {

     public static void main(String[] args) {
     File fichier = new File("D:/NetBeans/fichier_excel.xls") ;
  
        try{

        WritableWorkbook ww = Workbook.createWorkbook(fichier);

        Sheet wSheet = ww.createSheet("premier", 0);

        WritableFont arial10font = new WritableFont (WritableFont.ARIAL, 10);
        WritableCellFormat arial10format = new WritableCellFormat(arial10font);

        LabelCell label0 = new Label(0, 0, "nom",arial10format );
        LabelCell label1 = new Label(1, 0, "prenom",arial10format);
        LabelCell label2 = new Label(0, 1, "ptit");
        LabelCell label3 = new Label(1, 1, "pimousse");
    
        wSheet.addCell(label0);
        wSheet.addCell(label1);
        wSheet.addCell(label2);
        wSheet.addCell(label3);
 
        ww.write();
        ww.close();
        }catch(IOException e){
        }catch(jxl.JXLException er){}
        }
}

Toujours présent!
0
cs_MoH008 Messages postés 238 Date d'inscription lundi 2 mars 2009 Statut Membre Dernière intervention 29 septembre 2011 1
17 juin 2009 à 18:05
Salut,
il n'y pas de ligne d'erreur ?
as tu tenté d'insérer dans d'autres cellules?

The possible meet the impossible to become the possimpible !!
0
Rejoignez-nous