Reply to topic  [ 2 posts ] 
Response object 
Author Message
Reply with quote
Post 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?


Wed May 17, 2006 12:21 am

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 189
Location: Brasov, Romania
Reply with quote
Post 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()


Wed May 17, 2006 1:51 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.