J'ai pu transferer mes donnees de la DB à la JTable,à present je voudrais exporter le tout dans un fichier peu importe lequel,mon souhait serait un fichier pdf.
J'ai pu transferer mes donnees de la DB à la JTable,à present je voudrais exporter le tout dans un fichier peu importe lequel,mon souhait serait un fichier pdf.
Bah on en revient soit à itext soit à fop...., et donc à tes posts précédents....![]()
Hey, this is mine. That's mine. All this is mine. I'm claiming all this as mine. Except that bit. I don't want that bit. But all the rest of this is mine. Hey, this has been a really good day. I've eaten five times, I've slept six times, and I've made a lot of things mine. Tomorrow, I'm gonna see if I can't have sex with something.
Effectivement je n'ai aucune idee de comment fonctionne itext,fop ou jfree.Mon anglais n'est pas vraiment pointu par rapport aux tutorials kils proposent.
Code : Sélectionner tout - Visualiser dans une fenêtre à part Bah on en revient soit à itext soit à fop...., et donc à tes posts précédents....
Une directive sur la facon de proceder me serait d'un aide tres precieux.
a+
Eventuellement tu as cette page sur laquelle il y a paquets d'exemples et ne nécessitant pas d'immenses connaissances en anglais (au pire un bon dico suffira pour les deux trois termes un peu chauds):
http://itextdocs.lowagie.com/tutorial/
Mais sinon plus généralement, la doc en anglais, quelques soit l'API tu n'y échaperas pas
Hey, this is mine. That's mine. All this is mine. I'm claiming all this as mine. Except that bit. I don't want that bit. But all the rest of this is mine. Hey, this has been a really good day. I've eaten five times, I've slept six times, and I've made a lot of things mine. Tomorrow, I'm gonna see if I can't have sex with something.
Tjours pas de reultats.Voici par exemple un exemple de programm eque j'utilise:
voici le reultat de la compilation:
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 import java.io.FileOutputStream; import java.io.IOException; import javax.swing.text.Document; import com.lowagie.text.Document; import com.lowagie.text.pdf.PdfWriter; public class HelloWorld { /** * Generates a PDF file with the text 'Hello World' * * @param args no arguments needed here */ public static void main(String[] args) { System.out.println("Hello World"); // step 1: creation of a document-object /*44*/ Document document = new Document(); try { // step 2: // we create a writer that listens to the document // and directs a PDF-stream to a file PdfWriter.getInstance(document, new FileOutputStream("HelloWorld.pdf")); // step 3: we open the document document.open(); // step 4: we add a paragraph to the document document.add(new Paragraph("Hello World")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } // step 5: we close the document document.close(); } }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 The method getInstance(Document, OutputStream) in the type PdfWriter is not applicable for the arguments (Document, FileOutputStream) The method open() is undefined for the type Document Paragraph cannot be resolved to a type DocumentException cannot be resolved to a type de cannot be resolved The method close() is undefined for the type Document at HelloWorld.main(HelloWorld.java:44)
ben il ne doit pas prendre le bon Document
essaie
à la ligne 44.
Code : Sélectionner tout - Visualiser dans une fenêtre à part com.lowagie.text.Document document = new Document();
(à moins que je me gourre de syntaxe)
mais bon les erreurs parlent d'elle-mêmes. Les méthodes que tu utilises n'existent pas pour le type Document que tu utilises...
[EDIT] Pour le type paragraphe et DocumentException, tu n'a pas fais l'import ! c'est normal qu'il ne trouve pas
"If email had been around before the telephone was invented, people would have said, 'Hey, forget email! With this new telephone invention I can actually talk to people!"
Besoin d'une nouvelle méthode pour développer ? -> http://www.la-rache.com/
Tant que tu y est vire leil ne sert à rien et t'embrouillera plus qu'autre chose
Code : Sélectionner tout - Visualiser dans une fenêtre à part import javax.swing.text.Document;
Hey, this is mine. That's mine. All this is mine. I'm claiming all this as mine. Except that bit. I don't want that bit. But all the rest of this is mine. Hey, this has been a really good day. I've eaten five times, I've slept six times, and I've made a lot of things mine. Tomorrow, I'm gonna see if I can't have sex with something.
ben écoute c'est pas possible. je viens de regarder la javadoc de la lib que tu utilise, c'est bon.
C'est obligé, tu ne fais pas appel au bon type de Document...
fais voir comment tu le déclare (et tes import)
"If email had been around before the telephone was invented, people would have said, 'Hey, forget email! With this new telephone invention I can actually talk to people!"
Besoin d'une nouvelle méthode pour développer ? -> http://www.la-rache.com/
voici mon programme:
En rouge ce sont les points "unressolved"
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 import java.io.FileOutputStream; import java.io.IOException; import com.lowagie.text.Document; import com.lowagie.text.pdf.PdfWriter; public class HelloWorld { /** * Generates a PDF file with the text 'Hello World' * * @param args no arguments needed here */ public static void main(String[] args) { System.out.println("Hello World"); // step 1: creation of a document-object Document document = new Document(); try { // step 2: // we create a writer that listens to the document // and directs a PDF-stream to a file PdfWriter.getInstance(document, new FileOutputStream("HelloWorld.pdf")); // step 3: we open the document document.open(); // step 4: we add a paragraph to the document /*Line 52*/ document.add(new Paragraph("Hello World")); } catch (DocumentException de) { System.err.println(de.getMessage()); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } // step 5: we close the document document.close(); } }
voici la reponse du compilateur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 Exception in thread "main" java.lang.Error: Unresolved compilation problems: Paragraph cannot be resolved to a type DocumentException cannot be resolved to a type de cannot be resolved at HelloWorld.main(HelloWorld.java:52)
peut être que si tu faisais les import ça marcherait !![]()
"If email had been around before the telephone was invented, people would have said, 'Hey, forget email! With this new telephone invention I can actually talk to people!"
Besoin d'une nouvelle méthode pour développer ? -> http://www.la-rache.com/
J'ai donc fait des imports,sinon de quels imports s'agit-il?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 import java.io.FileOutputStream; import java.io.IOException; import com.lowagie.text.Document; import com.lowagie.text.pdf.PdfWriter;
Ben ? t'es sûr t'as pas une vague idée ? Ya pas des types qu'il n'arrive pas à résoudre ?
Aller la réponse :
franchement
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 import com.lowagie.text.Paragraph import com.lowagie.text.DocumentException![]()
"If email had been around before the telephone was invented, people would have said, 'Hey, forget email! With this new telephone invention I can actually talk to people!"
Besoin d'une nouvelle méthode pour développer ? -> http://www.la-rache.com/
n'ya t'il personne pour m'aider sur ce coup
Enfin de coöpte j'ai reussi.c'etait juste un probleme de Path.
Mantenant j'ai quasi termne mon projet,je remercis tous ceux qui m'ont file des tuyaux.Notament:Regis,wichtounet,et tous les autres...
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager