473,326 Members | 2,168 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,326 software developers and data experts.

Problem to Export in Excel data format


Hi !
I have a table on an aspx page and i want to export its rows into an Excel
File, the script is

Page.Response.Clear()
Page.Response.ClearContent()
Page.Response.ClearHeaders()

Me.TBLexcel.RenderControl(oHTMLWriter)
Page.Response.Write("<html><head></head><body>")
Page.Response.Write(oStringWriter)
Page.Response.Write("</body></html>")
Response.charset="utf-8"
Dim OpenType As String = "attachment"
Page.Response.ContentType = "application/ms-excel"
Page.Response.AddHeader("Content-Disposition", OpenType + ";filename="
+FileName)
Page.Response.End()
But, if i open the file with notepad i find= Members of community Facoltà
di Economia
if i open the file with excel i find= Members of community Facoltà di
Economia
so, there is a problem with encoding, but i don't understand where !
Nov 19 '05 #1
1 1132
The complete code:
Dim FileName As String = "Iscritti.xls"
Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim oHTMLWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)
Page.Response.Clear()

Me.TBLexcel.RenderControl(oHTMLWriter)
Dim OpenType As String = "attachment"
Page.Response.ContentType = "application/ms-excel"
Page.Response.AddHeader("Content-Disposition", OpenType + ";filename=" +
FileName)
Page.Response.Write(oStringWriter)
Page.Response.End()
The problem is with object "oStringWriter ",it uses unicode and not UTF-8,
but it's not possible to change this encoding
Nov 19 '05 #2

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

Similar topics

2
by: Damien | last post by:
Hi to all, I need to design an import/export system. Data comes from a filemaker pro DB in a big CSV file. Some alterations are made on the data as it is imported into my mysql table. Data is...
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: PerryC | last post by:
Is there a way to export an MS Access Report to Word/Excel that looks EXACTLY like it appears in Access? When I export to Excel, only certain data appears, titles, headings... all missing. The...
5
by: Igor | last post by:
Hi everyone! I have a question about exporting data to Microsoft Excel. I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but...
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...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
1
by: huseinv | last post by:
Hi. I have a search tool which gives data in listing format and grid format (based on selection) on the same asp page. If a user select grid, the result is listed in grid format. Now how i can...
3
by: jmarcrum | last post by:
I want to export a report (that contains two separate queries, 1. Current year data, and 2. split-year data) from access into excel, but everytime I run my code and export the data to excel, it looks...
2
by: Dhananjay | last post by:
Hi all , I have got problem when i am tring to exportGridview Data into Excel format. It is going into text format ,but what i want is if the field is number/currency then it should go into...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
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
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.