c#, custom reporting.

Nope. When I request the page to be transferred back to the client, I do it as follows:

Code:
ExcelWriter writer = new ExcelWriter(dt);
string path = writer.SaveWorkbook();

path = Request.ApplicationPath + "/" + path.Substring(path.IndexOf("Export"));

Response.ClearContent();
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=Custom_Report.xlsx");
Response.WriteFile(path);
Response.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();

EDIT: An Office 2007 document IS a zip file, just renamed to the appropriate document type (i.e. docx for Word, xlsx for Excel, etc)
 
Last edited:
Nope. When I request the page to be transferred back to the client, I do it as follows:

Code:
ExcelWriter writer = new ExcelWriter(dt);
string path = writer.SaveWorkbook();

path = Request.ApplicationPath + "/" + path.Substring(path.IndexOf("Export"));

Response.ClearContent();
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=Custom_Report.xlsx");
Response.WriteFile(path);
Response.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();

EDIT: An Office 2007 document IS a zip file, just renamed to the appropriate document type (i.e. docx for Word, xlsx for Excel, etc)

i see - thanx :)
 
Yup - hehehe. That's a nice summary of the book I read through.

EDIT: Just remember to provide users using Office XP and 2003 with this link to enable them to open XLSX files.
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X