on 03-20-2009 7:34 PM
Hello all,
I want to show a typical window for downloading a file, where the user select the directory she/he want and give the file a name. Then, save in a string attribute to the path and file name chosen by the user.
In this way, i already have the path to save the excel i created on the PC client.
Best Regards,
Jennifer Lohan.
Hi,
Following might be of use for you https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a...
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ayyapparaj,
I used the library JExcelApi. The code I use to generate the excel is as follows, where I need to include in the PATH variable the directory where the user want to save the file.
What I need is to show the window for the user to choose where they want to save the excel file and overwrite the variable path.
How do I do? Any sample code to make the save browse and get the path?
(Example: C:\Documents and Settings\All Users...etc)
try
{
//Set path
String path = "Example.xls";
File fich = new File(path);
//Creating Workbook.
WritableWorkbook workbook = Workbook.createWorkbook(fich);
//Creating sheet.
WritableSheet sheet = workbook.createSheet("SheetExample", 0);
//Fill headers columns.
sheet.addCell(new jxl.write.Label(0,0,"Name"));
sheet.addCell(new jxl.write.Label(1,0,"Last Name"));
sheet.addCell(new jxl.write.Label(2,0,"Amount"));
// Fill cells.
sheet.addCell(new jxl.write.Label(0, 1, "John"));
sheet.addCell(new jxl.write.Label(1, 1, "Smith"));
sheet.addCell(new jxl.write.Number(2, 1, 1.20));
//Enter the result in the excel file.
workbook.write();
workbook.close();
System.out.println("Complete example.");
}
catch (IOException ex)
{
System.out.println("Failed to create file.");
}
catch (WriteException ex)
{
System.out.println("Error writing file.");
}
Best Regards,
Jennifer Lohan.
Hello all,
I found this link on how to do it.
https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/webDynproJava-ExportingTableDataUsingOn-DemandStreams-SAPNW+7.0
But the file that creates an xml. Is there any way to display the Save Dialog PopUp like this "Do you
want to open or save this file?" and get the route chosen by the user? So I will use the library jExcelApi.
Best Regards,
Jennifer Lohan.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.