473,320 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Content Type = EXCEL in browser

I'm trying to change content type of an ASPX page in the
browser and send some data so the browser mimics an EXCEL
spreadsheet (changed the content type to excel for the
ASPX page), but its getting the data from a previous page.
I'm doing a server transfer from a previous page. I've
also tried to flush the buffer at the page load before I
do anything, but this doesn't work. Below is my code. I'd
appreciate anyone who could lead me to a Q article on how
to do this in .NET. I've done this in classic ASP, but
not .NET.

Thanks

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Response.ClearContent()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-
excel"
'''''''''''''''''''''''''''''''''''''''
'''''''''''''
dvwEntityTypeProperties = New
DataView(dtblEntityTypeProperties)
dvwEntityTypeProperties.Sort = "Name"
Dim aCnt As Integer =
dvwEntityTypeProperties.Count
drgEntityTypeProperties.DataSource =
dvwEntityTypeProperties
y = 0
For Each fr In findResults.Results
dvwEntityTypeProperties(y)
("RedCircle") = "RedCircle" & CType(y + 1, String)
y = y + 1
Next

drgEntityTypeProperties.DataBind()
'''''''''''''''''''''''''''''''''''''''
'''
End If

Catch myException As SoapException

Debug.Assert(False, "Error occurred while
attempting to perform a FindNearby request: " +
myException.Message)

End Try
End If

End Sub
Nov 17 '05 #1
0 2518

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: yanir | last post by:
Hi I use reponse.contenttype = "application/vnd.ms-excel" So the browser will show the data in excel format, but for some fields I use leading zero's, which truncated by the browser, at this...
2
by: bill | last post by:
Hi All, When I send html content with Excel MIME type, the page break style sheet {page-break-before: always} doesn't work at Excel spreadsheet. Any idea to convert html page break style sheet to...
0
by: Yelena Kaplun | last post by:
Hi, I'm trying to customize print settings while streaming HTML content into Excel. I'm using ASP.NET 1.1 and Excel 2003. While some printer settings like Margins are working correctly, I cannot...
0
by: Chris Davoli | last post by:
I'm trying to change content type of an ASPX page in the browser and send some data so the browser mimics an EXCEL spreadsheet (changed the content type to excel for the ASPX page), but its...
3
by: hunt n peck | last post by:
is there a manual way code the "ContentType" header property? if i build an HTML page with <meta name="Content-Type" content="application/vnd.ms-excel"> in the header the browser just loads the...
4
by: Jed | last post by:
I have looked everywhere and cannot find a resolution for this. I have read several post on this forum that allude to similar issues but I have not found a solution. I am sending dynamic...
1
by: athirumurthi | last post by:
I have a WinINet communicating with an integration server (X-AspNet-Version: 1.1.4322) using form posts. One form post that includes jpeg content. However, the data received at the server is...
0
by: veenakj | last post by:
Hello, We use ASP.NET. We have a page with Excel download link when clicked it is supposed to render the excel data in browser. Below is the header info we set Response.ContentType =...
4
by: shypen42 | last post by:
Hi, I'd like to know how to serve web pages as "cleanly" as possible, maybe validating them if it's possible. How should I do to both respect standards *and* have it work under the various IE...
3
by: Bob Murdoch | last post by:
I'm using the following to send a binary file to a user: Response.AddHeader('Content-Disposition','attachment;filename=' + Request('FileName') + ';'); var vType = 'application/octetstream';...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.