on 02-25-2009 6:29 AM
Hi,
When i export my table contents to MS Excel the name of the excel file is CAHWJARD.xls and i am not getting the file name which i have mentioned in export to excel code.In Internet Explorer 6.0 i am facing this problem, but in IE 7.0 the name of the Excel file is coming correctly.
Please help me in solving this problem with IE 6.0.
Regards,
Bala Baskaran.S
Hi,
try this code to getbthe path of the file. and to store the file.
File file=new File("CAHWJARD.xls");
FileOutputStream out; // declare a file output object
PrintStream p; // declare a print stream object
try
{
// Create a new file output stream
// connected to "myfile.txt"
out = new FileOutputStream(file);
// Connect print stream to the output stream
p = new PrintStream(out);
p.println ("Leave form");
p.println("Employe id is-------- "+str1+"\n");
p.println("Employe name is------ "+Str2+"\n");
p.println("Start date----------- "+Str3+"\n");
p.println("End date------------- "+Str4+"\n");
p.println("No of working days--- "+Str5+"\n");
resourcePath =
WDURLGenerator.getResourcePath(
wdComponentAPI.getDeployableObjectPart(),
str6);
path = file.getAbsolutePath();
p.close();
}
catch (Exception e)
{
wdComponentAPI.getMessageManager().reportException("Error writing to file",false);
}
try{
String resourcePath;
String path;
resourcePath = WDURLGenerator.getResourcePath( wdComponentAPI.getDeployableObjectPart(),"CAHWJARD.xls");
path = file.getAbsolutePath();
wdComponentAPI.getMessageManager().reportSuccess(path.toString());
}catch(Exception e)
{
e.printStackTrace();
}
Regards,
H.V.Swathi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Bala,
I have also implemented export to excel with 6.0 version only and it is working fine.
Make sure that you have exported all the jxl jars and also copied the jxl jar into lib folder of your project.
For refrence just refer to the code below:
String fileName = "Tickets" + ".xls";
IWDCachedWebResource cachedExcelResource = null;
try {
try {
File f = new File("Tickets.xls");
WritableWorkbook workbook;
workbook = Workbook.createWorkbook(f);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anupama,
I suppose in this case, the code is not affecting anything coz the results are coming as desired with version 7. Well, I am not sure but...
Bala,
There might be some other problem. Try with deleting the cookies & set the security & privacy level to low.
That might work out the things.
Regards
Chander Kararia
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.