please am using Itext to create report but everything goes to the App Data in
the drive C:
please can you give me an alternative so that after installing the user can
direct where he chooses to save the reports after generating. thanks.
}
/* Attach report table to PDF */
my_pdf_report.add(my_report_table);
/* Close all DB related objects */
//adding List Items
com.itextpdf.text.List list = new com.itextpdf.text.List(true, 20);
list.add("General Comment
:................................................\t
\n................................................................................\n................................................................................\n");
list.add("Admin's Remarks
:........................................................\t
\n................................................................................\n................................................................................\n");
To make the user select a path in Java Swing, use JFileChooser instead:
JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(new java.io.File("."));
chooser.setDialogTitle("Choose the destination path");
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // Only folders
chooser.setAcceptAllFileFilterUsed(false);
if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
String dataFolder = chooser.getCurrentDirectory() + ch + ".pdf";;
} else {
// Show error message here or perform any failure action you want to
}
am highly grateful it worked as i wanted. PERFECT.
Please Mr. David with respect to the JavaFX i have no idea but if you can give
me tutorial notes .pdf on it i will do perfectly well.
hope to get that help from you because I Love working with java than any other
platform.
thanks very much.
from Jones.