473,396 Members | 1,655 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,396 software developers and data experts.

exporting excel in asp.net

I have a page that has a button and it exports fine on the laptop but
when I drop it on the server and hit it from a client machine on the
LAN (https) it gives me an explorer error that it cannot download the
page... The server has some certificates needs that my laptop does not,
not sure if that is it. Any help would be awesome. code below:

Protected Sub btnExcel_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnExcel.Click
Dim stringWrite
Dim htmlWrite

Response.Clear()
Response.AddHeader("content-disposition",
"inline;filename=EPRTracker.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.ContentType = "application/vnd.xls"
stringWrite = New System.IO.StringWriter()
htmlWrite = New HtmlTextWriter(stringWrite)
Dim grdNew As New GridView()
'grdNew.AutoGenerateColumns = True
grdNew.DataSource =
EPRTrackerLibrary.EPRTrackerView.GetStaffMeetRepor tDR
grdNew.DataBind()

grdNew.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()
End Sub

Aug 31 '06 #1
1 1323
Attempt to hit another SSL page (https) and see if you have a certificate
issue (server certificate). If so, correct it by trusting the root. This
will have to be done on EVERY client.

If, instead, you mean client side certs, that should not be a major deal.

Also, make sure you have the Excel MIME type registered. I doubt it is your
issue, but it WILL Cause issues of is own later.

Hope this helps.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
<th************@hotmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
>I have a page that has a button and it exports fine on the laptop but
when I drop it on the server and hit it from a client machine on the
LAN (https) it gives me an explorer error that it cannot download the
page... The server has some certificates needs that my laptop does not,
not sure if that is it. Any help would be awesome. code below:

Protected Sub btnExcel_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnExcel.Click
Dim stringWrite
Dim htmlWrite

Response.Clear()
Response.AddHeader("content-disposition",
"inline;filename=EPRTracker.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.ContentType = "application/vnd.xls"
stringWrite = New System.IO.StringWriter()
htmlWrite = New HtmlTextWriter(stringWrite)
Dim grdNew As New GridView()
'grdNew.AutoGenerateColumns = True
grdNew.DataSource =
EPRTrackerLibrary.EPRTrackerView.GetStaffMeetRepor tDR
grdNew.DataBind()

grdNew.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()
End Sub

Aug 31 '06 #2

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

Similar topics

3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
4
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear"...
2
by: G | last post by:
When I export data from access to excel by with "export" or "Analyze with" I seem to loose parts of some fields (long text strings). Is there a way to export it all to excel? Thanks G
2
by: Kenneth | last post by:
How do I remove the limitation in Access that deny me from exporting 24000 rows and 17 columns (in a query) into Excel? Kenneth
5
by: Neil | last post by:
Hi I'm currently exporting my datagrid to excel, taking advantage of the fact that excel can render html, the problem is that when i click the button to export it opens in browser, I want the button...
2
by: Mustufa Baig | last post by:
Hi everybody, I have an ASP.NET website where clients can view their monthly billings by selecting different options. One of the option is the way they want to see the report i.e. whether they...
1
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream...
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
4
by: Tom | last post by:
I have a gridview on all of my web pages in my web app and they all export to excel. I have one page where the gridview is binding to a datatable that i created and only the first column is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.