EasyXLS http://forum.easyxls.com/ |
|
Response object http://forum.easyxls.com/viewtopic.php?f=5&t=14 |
Page 1 of 1 |
Author: | Jean [ Wed May 17, 2006 12:21 am ] |
Post subject: | Response object |
How does one use easy_WriteExcelFile() to write to the Response object in ASP.NET (using VB) - rather than to a FileStream or File? |
Author: | daniela [ Wed May 17, 2006 1:51 pm ] |
Post subject: | Write to Response for web projects |
It is possible to write to the Response object and skip writing the file on hard-drive. Here is some sample code: 'Create an instance of the object that generates Excel files Dim xls As New ExcelDocument 'Choose a name for the xls file Dim shortFileName As String = "ListData.xls" 'Start to prepare the Response Response.AppendHeader("content-disposition", "attachment; filename=" + shortFileName) Response.ContentType = "application/octetstream" Response.Clear() 'Generate the file and prompt the "Open or Save Dialog Box" xls.easy_WriteExcelFile(Response.OutputStream, sLicense, sLicenseKey) 'Finishing the job xls.Dispose() Response.End() |
Page 1 of 1 | All times are UTC - 4 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |