Response.ContentType = "application/force-download"; Response.AddHeader("content-disposition", "attachment; filename=Report.xls"); Response.Write("<html xmlns:x=\"urn:schemas-microsoft-com:office:excel\">"); Response.Write("<head>"); Response.Write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"); Response.Write("<!--[if gte mso 9]><xml>"); Response.Write("<x:ExcelWorkbook>"); Response.Write("<x:ExcelWorksheets>"); Response.Write("<x:ExcelWorksheet>"); Response.Write("<x:Name>Report Data</x:Name>"); Response.Write("<x:WorksheetOptions>"); Response.Write("<x:Print>"); Response.Write("<x:ValidPrinterInfo/>"); Response.Write("</x:Print>"); Response.Write("</x:WorksheetOptions>"); Response.Write("</x:ExcelWorksheet>"); Response.Write("</x:ExcelWorksheets>"); Response.Write("</x:ExcelWorkbook>"); Response.Write("</xml>"); Response.Write("<![endif]--> "); Response.Write("</head>"); /// /// Assign your HTML content here /// Response.Write(output); Response.Flush();
Monday, June 28, 2010
How to export html in to Microsoft Excel - Asp.net
This article demonstrate how to export html as Microsoft xl format
Subscribe to:
Post Comments (Atom)
Azure Storage Account Types
Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...
-
Symptom: Solution includes a web project and a class library(may be more). But can not hit any break points in class library as it says ‘no ...
-
Demo: I was thinking a way to show images before actually uploading them to server. I would say to preview images using javascript. Obv...
No comments:
Post a Comment