Hi,
I am facing a problem with export to excel. I am having a template xlsx file, in the process i am unzipping that in to a folder and pushing my data in to sheet1.xml. then zipping it back as xlsx file. My application has both win and web version. in win version it works perfectly. but for the web version i have to give it as download to the user.
currently i am doing the following
string tempFile = tempFolder + ".xlsx";
Page.Response.C lear();
Page.Response.C ontentType = "applicatio n/vnd.ms-excel";
Page.Response.A ddHeader("Conte nt-Disposition", "attachment;fil ename=" + tempFile);
Page.Response.W riteFile(tempFi le);
the problem is when the user saves it and opens it it says, excel is unreadable. do you want to recover it?.. if i click "yes" my exported details are coming up nicely.
not sure what is missing. also i have noticed one thing, the file size before i give the download i 26k, after saving itin the disk it is 72k
Also i am using GUID for the file names so that it will be unique. i have to delete the file once user downloads that. how to do that?
please help!!.
Thanks in advance.
Arunkumar.s
I am facing a problem with export to excel. I am having a template xlsx file, in the process i am unzipping that in to a folder and pushing my data in to sheet1.xml. then zipping it back as xlsx file. My application has both win and web version. in win version it works perfectly. but for the web version i have to give it as download to the user.
currently i am doing the following
string tempFile = tempFolder + ".xlsx";
Page.Response.C lear();
Page.Response.C ontentType = "applicatio n/vnd.ms-excel";
Page.Response.A ddHeader("Conte nt-Disposition", "attachment;fil ename=" + tempFile);
Page.Response.W riteFile(tempFi le);
the problem is when the user saves it and opens it it says, excel is unreadable. do you want to recover it?.. if i click "yes" my exported details are coming up nicely.
not sure what is missing. also i have noticed one thing, the file size before i give the download i 26k, after saving itin the disk it is 72k
Also i am using GUID for the file names so that it will be unique. i have to delete the file once user downloads that. how to do that?
please help!!.
Thanks in advance.
Arunkumar.s