IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java Discussion :

Créer un Excel et exporter des données


Sujet :

Java

  1. #1
    Membre régulier
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    286
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Avril 2013
    Messages : 286
    Points : 76
    Points
    76
    Par défaut Créer un Excel et exporter des données
    Bonsoir,

    Je viens de faire un code pour créer un fichier excel dans lequel il y a 3 colonnes adresseip+hostname+etat
    ces trois sont des parametres d'une classe java Etat.java
    donc j'ai crée cette classe voilà le code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package telnet;
     
    /**
     *
     * @author Youness
     */
    public class Etat {
        private  String Hostname;
        private  String adresses;
        private  String etat;
     
        public Etat (String Hostname, String adresses, String etat)
      {
        this.Hostname = Hostname;
        this.adresses = adresses;
        this.etat = etat;
      }
     
     
        public String getHostname()
          {
            return Hostname;
          }          
     
        public String getAdresseip()
          {
            return adresses;
          } 
        public String getEtat()
          {
            return etat;
          }
        public String toString()
          {
           return Hostname +" "+ adresses+" "+etat;
     
          }
     
     
     
       }
    Puis le code pour créer un ArrayList via lequel on stock les données dans un nouveau Excel
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    package telnet;
     
    import java.io.File;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.Vector;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.format.Colour;
    import jxl.format.UnderlineStyle;
    import jxl.read.biff.BiffException;
    import jxl.write.*;
    import jxl.write.biff.RowsExceededException;
     
    /**
     *
     * @author wassila
     */
    public class xls1 {   
        private int ind;
     
        public xls1(){
        }
     
        public int GetInd(){
            return ind;
        }
            public void XLS_Export(ArrayList<Etat> liste){
            JFrame controllingFrame = new JFrame();
            ArrayList<Etat> etat;
            ind = 0;
            try {
     
               Workbook workbook = null;
                    int i,m;
                    boolean bool = false;
                    String stringa1 = null;
                    String version = null;
     
                    try {
                              workbook = Workbook.getWorkbook(new File("model/Model.xls"));
                           } catch (BiffException e1) {
                                   // TODO Auto-generated catch block
                                   e1.printStackTrace();
                           } catch (IOException e1) {
                                   // TODO Auto-generated catch block
                                   e1.printStackTrace();
                           }
                     Sheet sheet = workbook.getSheet(0);
             WritableWorkbook copy = Workbook.createWorkbook(new File("Diagnostic/Route Diag.xls"), workbook);
                     WritableSheet Add = copy.getSheet(0);  
     
            WritableCellFormat formatRed = new WritableCellFormat(new WritableFont(WritableFont.TIMES,10,
                     WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.RED));
     
                     WritableCellFormat formatBlack = new WritableCellFormat(new WritableFont(WritableFont.ARIAL,10,
                     WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK));
     
                     System.out.println("Export XLS");
                   Label label2;
                  for(int n=0,ligne=0;n<liste.size();n++){
                     etat = new ArrayList<Etat>(liste.get(n).GetListe());
                      System.out.println(n+"/"+liste.size());
                   for(i=0;i<etat.size();i++){ 
                      if(etat.get(i).getDiag().equals("NOK")){
                          ind++;
                      }   
              label2 = new Label(1,ligne+2, etat.get(i).getAdresseip(),formatBlack);
                      Add.addCell(label2);
              label2 = new Label(2,ligne+2, etat.get(i).getHostname(),formatBlack);
                      Add.addCell(label2);
               label2 = new Label(3,ligne+2, etat.get(i).getEtat(),formatRed);
                      Add.addCell(label2);
     
                      ligne++;
                   }
                  }
     
                   	   workbook.close(); 
       		   copy.write();
    		   copy.close();
            } catch (WriteException ex) {
                Logger.getLogger(xls1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(xls1.class.getName()).log(Level.SEVERE, null, ex);
            }
     
            /*try {
                        Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler Diagnostic.xls");
                    } catch (Exception ee) {JOptionPane.showMessageDialog(controllingFrame, "there is a problem, "
                            + "the Excel File can not be opened");}// afficher le fichier avec l'execution
    */
     
    }
    }
    Et ce qu'il me reste c'est la classe main pour tester est ce que quelqu'un peut m'aider s'il vous plait
    Merci

  2. #2
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 551
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 551
    Points : 21 607
    Points
    21 607
    Par défaut
    Citation Envoyé par cisco.nat Voir le message
    puis le code pour créer un arraylist via lequel on stock les données dans un nouveau excel
    Je ne vois aucune création d'ArrayList. Rien qui serve à quelque chose du moins.

    Citation Envoyé par cisco.nat Voir le message
    Et ce qu'il me reste c'est la classe main pour tester est ce que quelqu'un peut m'aider s'il vous plait
    A priori je dirais que ta classe main devrait contenir une méthode

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    public static void main(String... args) {
      // A DEFINIR
    }
    Et que son contenu devrait se charger d'appeler ta classe xls1.
    Bien sûr, je ne comprends pas ce qu'elle est censée faire et à quoi correspondent les méthodes, leurs paramètres et leurs types de retour. Alors je peux pas te dire quoi mettre.
    Mais pour tester, on fait comme ça.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  3. #3
    Membre régulier
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    286
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Avril 2013
    Messages : 286
    Points : 76
    Points
    76
    Par défaut
    Le problème c'est que je sais pas comment tester et faire un appel à la classe xls1 c'est çà le problème. Et le ArrayList on l'a crée avec la classe Etat
    lorsque j'ai fait ça : public void XLS_Export(ArrayList<Etat> liste)
    Le but c'est d'entrer via la classe test les 3 données ip+hostname+etat pour les ajouter dans le fichier Excel.

    Bon je suis en 5eme année Réseau et système et je suis en Stage PFE alors ils m'ont demandé de développer une application java et je suis presque nulle en java.

    Merci d'avance pour votre aide.

  4. #4
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 551
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 551
    Points : 21 607
    Points
    21 607
    Par défaut
    Citation Envoyé par cisco.nat Voir le message
    Le problème c'est que je sais pas comment tester et faire un appel à la classe xls1 c'est çà le problème.
    Je dirais, commencer par en créer une instance avec new, puis appeler la méthode voulue sur l'objet créé.

    Citation Envoyé par cisco.nat Voir le message
    Et le ArrayList on l'a crée avec la classe Etat
    lorsque j'ai fait ça : public void XLS_Export(ArrayList<Etat> liste)
    Cela ne crée rien du tout, ça prend juste une ArrayList en paramètre. Il va bien falloir en créer une à un moment, mais cette ligne ne le fait pas.

    Citation Envoyé par cisco.nat Voir le message
    Le but c'est d'entrer via la classe test les 3 données ip+hostname+etat pour les ajouter dans le fichier Excel.
    Super, mais je ne vois pas comment ton code est censé faire ça.

    Citation Envoyé par cisco.nat Voir le message
    Bon je suis en 5eme année Réseau et système et je suis en Stage PFE alors ils m'ont demandé de développer une application java et je suis presque nulle en java.
    Pas "presque." Quand on a même pas commencé à apprendre une technologie, c'est un peu normal d'être nul dans cette technologie. Y a pas de honte, on commence tous débutant.
    Mais la première étape c'est d'apprendre ce langage. Ensuite seulement, quand tu auras commencé à comprendre vaguement comment marchent deux ou trois trucs, tu pourras essayer de construire un vrai programme utile avec.
    Mais pour l'instant il veut rien dire ton bazar. Il faut au moins que tu arrives à poser des vraies questions, c'est un minimum.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  5. #5
    Membre régulier
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    286
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Avril 2013
    Messages : 286
    Points : 76
    Points
    76
    Par défaut
    Bon moi j'ai besoin d'aide pour faire le main du classe xls.java
    c'est à dire entrer un ip+host+etat
    si vous avez vu c'est ici qu'on a donné les 3 données à excel
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    label2 = new Label(1,ligne+2, etat.get(i).getAdresseip(),formatBlack);
    Add.addCell(label2);
    label2 = new Label(2,ligne+2, etat.get(i).getHostname(),formatBlack);
    Add.addCell(label2);
    label2 = new Label(3,ligne+2, etat.get(i).getEtat(),formatRed);
    Add.addCell(label2);
    sinon j'ai besoin d'aide pour corriger les erreurs du classe xls.java

  6. #6
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 551
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 551
    Points : 21 607
    Points
    21 607
    Par défaut
    Citation Envoyé par cisco.nat Voir le message
    Bon mois je veux que vous m'aider à faire le main du classe xls.java
    Déjà fait. Tu as essayé ?

    Citation Envoyé par cisco.nat Voir le message
    c'est à dire entrer un ip+host+etat
    A priori il s'agit de faire des new Etat(leHostname, lAdresse, lEtat);.
    Construire un ArrayList<Etat> et les mettre dedans.
    Puis passer cet ArrayList en paramètre de la méthode.
    Quelqu'un qui n'est pas capable de penser à ça n'arrivera pas à programmer quelque chose. Il faut apprendre encore.

    Citation Envoyé par cisco.nat Voir le message
    si vous avez vu c'est ici qu'on a donné les 3 données à excel
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    label2 = new Label(1,ligne+2, etat.get(i).getAdresseip(),formatBlack);
    Add.addCell(label2);
    label2 = new Label(2,ligne+2, etat.get(i).getHostname(),formatBlack);
    Add.addCell(label2);
    label2 = new Label(3,ligne+2, etat.get(i).getEtat(),formatRed);
    Add.addCell(label2);
    sinon j'ai besoin d'aide pour corriger les erreurs du classe xls.java
    Ce code se situe à l'intérieur de deux boucles for imbriquées, et il y a des histoires de GetListe() et GetDiag() qui n'ont pas l'air d'avoir de sens vu ce qui nous est montré. En principe ce code ne compile même pas avec la classe Etat que tu nous montres.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  7. #7
    Membre régulier
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    286
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Avril 2013
    Messages : 286
    Points : 76
    Points
    76
    Par défaut
    donc voilà j'ai travaillé sur ce code il'est correct mais il ne s'exécute pas il me donne des erreurs comme çà sur les 2 lignes suivantes:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
          workbook = Workbook.getWorkbook(new File("C:\\model/Model.xls"));
     
                  Sheet sheet = workbook.getSheet(0);
    je sais pas c'est quoi le problème

    les erreurs sont:
    jxl.read.biff.BiffException: Unable to recognize OLE stream
    at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:116)
    at jxl.read.biff.File.<init>(File.java:127)
    at jxl.Workbook.getWorkbook(Workbook.java:221)
    at jxl.Workbook.getWorkbook(Workbook.java:198)
    at telnet.xls.XLS_Export(xls.java:74)
    at telnet.Main1.main(Main1.java:29)
    Exception in thread "main" java.lang.NullPointerException
    at telnet.xls.XLS_Export(xls.java:82)
    at telnet.Main1.main(Main1.java:29)
    voilà le nouveau code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    public class Main1 {
        public static void main(String[] args) throws BiffException {
           xls xls=new xls();
           ArrayList<Etat> list=new ArrayList<Etat>();  
    	  Etat e=new Etat("R1","192.168.1.20","PE");	  
    	  list.add(e);
    	  e=new Etat("R2","192.168.1.21","PE");	  
    	  list.add(e);
           xls.XLS_Export(list);
           System.out.println("Model.xls"); 
        }
    }
    le code d'export xls
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    public class xls {   
        private int ind;
     
        public xls(){
        }
     
        public int GetInd(){
            return ind;
        }
     
        public void XLS_Export(ArrayList<Etat> liste){
            JFrame controllingFrame = new JFrame();
            ArrayList<Etat> etat;
            ind = 0;
            try {
     
               Workbook workbook = null;
                    int i,m;
                    boolean bool = false;
                    String stringa1 = null;
                    String version = null;
     
                    try {
                  workbook = Workbook.getWorkbook(new File("C:\\model/Model.xls"));
                           } catch (BiffException e1) {
                                   // TODO Auto-generated catch block
                                   e1.printStackTrace();
                           } catch (IOException e1) {
                                   // TODO Auto-generated catch block
                                   e1.printStackTrace();
                           }
            Sheet sheet = workbook.getSheet(0);
            WritableWorkbook copy = Workbook.createWorkbook(new File("C:\\model/Model.xls"), workbook);
                     WritableSheet Add = copy.getSheet(0);  
     
            WritableCellFormat formatRed = new WritableCellFormat(new WritableFont(WritableFont.TIMES,10,
                     WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.RED));
     
            WritableCellFormat formatBlack = new WritableCellFormat(new WritableFont(WritableFont.ARIAL,10,
                     WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK));
     
                     System.out.println("Export XLS");
                   Label label2;
                  /*for(int n=0,ligne=0;n<liste.size();n++){
                     etat = new ArrayList<Etat>(liste.get(n).GetListe());
                      System.out.println(n+"/"+liste.size());
                   for(i=0;i<etat.size();i++){ 
                      if(etat.get(i).getDiag().equals("NOK")){
                          ind++;
                      }   
              label2 = new Label(1,ligne+2, etat.get(i).getAdresseip(),formatBlack);
                      Add.addCell(label2);
              label2 = new Label(2,ligne+2, etat.get(i).getHostname(),formatBlack);
                      Add.addCell(label2);
               label2 = new Label(3,ligne+2, etat.get(i).getEtat(),formatRed);
                      Add.addCell(label2);
                     
                      ligne++;
                   }
                  }*/
    			  int ligne=0;
     
    			System.out.println("avant la boucle");
    			for(Etat e:liste)
                            {
    			System.out.println("en boucle");
    	//copy = Workbook.createWorkbook(new File("C:\\Model.xls"), workbook);
    	System.out.println(e.getAdresseip());
    	//Add = copy.getSheet(0); 
    	label2 = new Label(1,ligne+2, e.getAdresseip(),formatBlack);
                      Add.addCell(label2);
              label2 = new Label(2,ligne+2, e.getHostname(),formatBlack);
                      Add.addCell(label2);
               label2 = new Label(3,ligne+2, e.getEtat(),formatRed);
                      Add.addCell(label2);
    				  ligne++;
    			}			
                   	   workbook.close(); 
       		   copy.write();
    		   copy.close();
     
            } catch (WriteException ex) {
                Logger.getLogger(xls1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(xls1.class.getName()).log(Level.SEVERE, null, ex);
            }
     
            /*try {
                        Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler Diagnostic.xls");
                    } catch (Exception ee) {JOptionPane.showMessageDialog(controllingFrame, "there is a problem, "
                            + "the Excel File can not be opened");}// afficher le fichier avec l'execution
    */
     
    }
    }

  8. #8
    Membre régulier
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2013
    Messages
    286
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Avril 2013
    Messages : 286
    Points : 76
    Points
    76
    Par défaut
    voilà le code final du xls export

    mais il me donne les mêmes erreurs:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    package telnet;
     
    import java.io.File;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.Vector;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.format.Colour;
    import jxl.format.UnderlineStyle;
    import jxl.read.biff.BiffException;
    import jxl.write.*;
    import jxl.write.biff.RowsExceededException;
     
    /**
     *
     * @author wassila
     */
    public class xls1 {   
        private int ind;
     
        public xls1(){
        }
     
        public int GetInd(){
            return ind;
        }
    public void XLS_Export(ArrayList<Etat> liste){
            JFrame controllingFrame = new JFrame();
            ind = 0;
            try {
     
               Workbook workbook = null;
                    int m;
                    boolean bool = false;
                    String stringa1 = null;
                    String version = null;
     
                    try {
         workbook = Workbook.getWorkbook(new File("Model.xls"));
                           } catch (BiffException e1) {
                                   // TODO Auto-generated catch block
                                   e1.printStackTrace();
                           } catch (IOException e1) {
                                   // TODO Auto-generated catch block
                                   e1.printStackTrace();
                           }
            Sheet sheet = workbook.getSheet(0);
       WritableWorkbook copy = Workbook.createWorkbook(new File("Model.xls"), workbook);
                     WritableSheet Add = copy.getSheet(0);  
     
            WritableCellFormat formatRed = new WritableCellFormat(new WritableFont(WritableFont.TIMES,10,
                     WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.RED));
     
            WritableCellFormat formatBlack = new WritableCellFormat(new WritableFont(WritableFont.ARIAL,10,
                     WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK));
     
                     System.out.println("Export XLS");
                   Label label2;
                  for(int i=0,ligne=0;i<liste.size();i++){
                      //System.out.println(n+"/"+liste.size()); 
     
              label2 = new Label(1,ligne+2, liste.get(i).getAdresseip(),formatBlack);
                      Add.addCell(label2);
              label2 = new Label(2,ligne+2, liste.get(i).getHostname(),formatBlack);
                      Add.addCell(label2);
               label2 = new Label(3,ligne+2, liste.get(i).getEtat(),formatRed);
                      Add.addCell(label2);
     
                      ligne++;
     
                  }   
                   	   workbook.close(); 
       		   copy.write();
    		   copy.close();
            } catch (WriteException ex) {
                Logger.getLogger(xls1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(xls1.class.getName()).log(Level.SEVERE, null, ex);
            }
     
            /*try {
                        Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler Diagnostic.xls");
                    } catch (Exception ee) {JOptionPane.showMessageDialog(controllingFrame, "there is a problem, "
                            + "the Excel File can not be opened");}// afficher le fichier avec l'execution
    */
     
    }
    }

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. exporter des données access vers excel
    Par Sebastien_INR59 dans le forum Access
    Réponses: 8
    Dernier message: 20/06/2006, 23h29
  2. [VBA-E]Exporter des données d'Excel vers Access
    Par Mut dans le forum Macros et VBA Excel
    Réponses: 1
    Dernier message: 03/06/2006, 15h57
  3. [En cours]Exporter des données vers Excel
    Par Muhad'hib dans le forum Contribuez
    Réponses: 2
    Dernier message: 12/01/2006, 14h25
  4. exporter des données vers EXCEL!
    Par JauB dans le forum Macros et VBA Excel
    Réponses: 11
    Dernier message: 25/11/2005, 15h13
  5. Exporter des données d'un requete SQL vers excel (csv)
    Par PrinceMaster77 dans le forum ASP
    Réponses: 9
    Dernier message: 08/10/2005, 22h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo