Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel sheet problem

Hi,

I am using Response object in vb.net to download an excel sheet with
data.
It worked well and I could download excel file with data. But suddenly
It started downloading only blank excel sheet. even though the data
exists. Do I need to do any refreshing? or do I need to re-start IIS?

Dim dt As DataTable = DSCAG.Tables(0)

Dim strFileName As String = "Downloadfile.xls"
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Content-Disposition", "attachment;
filename=""" & strFileName & """")
Response.ContentEncoding = System.Text.Encoding.UTF7
Response.Charset = ""
EnableViewState = False
Dim oStringWriter As New System.IO.StringWriter
Dim oHTMLTextWriter As New
System.Web.UI.HtmlTextWriter(oStringWriter)

DGCAGReference.DataSource = dt
DGCAGReference.DataBind()

DGCAGReference.RenderControl(oHTMLTextWriter)

Dim strResponse As String = oStringWriter.ToString
strResponse = strResponse.Replace("</td", "&nbsp;</td")
Response.Write(strResponse)

I have noticed that in the blank excel sheet the excel sheet name is
".xls]Downloadfile[1]". I don't understand why the excel sheet name is
like that.

any ideas?

Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing from Excel Sheet Problem workerboy Excel Discussion (Misc queries) 0 August 18th 06 02:44 PM
Importing Excel Sheet Problem Mo[_8_] Excel Programming 1 March 13th 06 10:21 PM
problem in excel sheet SIRAJ Excel Programming 2 February 18th 06 10:38 AM
Excel sheet copy problem [email protected] Excel Programming 3 January 25th 06 05:00 PM
Problem: How to copy excel sheet in C++ sgwong Excel Programming 0 October 7th 05 02:54 AM


All times are GMT +1. The time now is 04:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"