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

Unicode Excel

I am currently doing an export to excel function with unicode in the
excel.
I grab the data from oracle using asp code and save into excel using
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "inline; filename=a.xls"

I manage to view the unicode (UTF-8) with some range of data but also
not able to view the correct character.

May I know why?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 6453
Dayron,

Can you show how you are saving the data? Also, what is it that you see
when you open up the file? Is it possible that the machine you are viewing
the Excel sheet on doesn't have the appropriate fonts/support for the
unicode character ranges you are using?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dayron" <kh***********@devdex.com> wrote in message
news:uE**************@TK2MSFTNGP10.phx.gbl...
I am currently doing an export to excel function with unicode in the
excel.
I grab the data from oracle using asp code and save into excel using
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "inline; filename=a.xls"

I manage to view the unicode (UTF-8) with some range of data but also
not able to view the correct character.

May I know why?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2
Nicholas Paldino,

Here is my code:

Dim x, OutputFilePath, outString, strDelimeter, atmp
strDelimeter = ReadText
OutputFilePath = Day(Date) & Month(Date) & Year(Date) & Hour(Time) &
Minute(Time) & Second(Time) & Int(Rnd*99) + 1
atmp = "<% codepage = 1200 " & strDelimeter
outString = atmp
outString = outString & "<% Response.Charset = ""UTF-8"" " &
strDelimeter & vbCrlf
outString = outString & "<% Response.ContentType =
""application/vnd.ms-excel"" " & vbCrlf
outString = outString & "Response.AddHeader ""Content-Disposition"",
""inline; " & ""
outString = outString & "filename=" & OutputFilePath & ".xls"" " &
vbCrlf
OutputFilePath = OutputFilePath & ".asp"

WriteTofile outString, OutputFilePath
WriteTofile strDelimeter, OutputFilePath
'Retrieving data from oracle process

Response.Write("<script language=""javascript"">")
Response.Write("window.open('Reports/" & OutputFilePath & "');")
Response.Write("</script>")
Public Function WriteToFile(Contents, FileName)
On Error Resume Next

Dim arrFile
arrFile = split(FileName, ".")
FileName = arrFile(0) & "." & arrFile(1)

FilePath = Server.MapPath(FileName)

If arrFile(1) = "htm" Then
Dim tempPath, objStream
tempPath = Mid(FilePath, 1, (Len(FilePath)-Len(FileName)))
FilePath = tempPath & "Reports\" & FileName
set oFs = server.createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(FilePath, 8, True)
oTextFile.Write Contents
oTextFile.Writeline ""
oTextFile.Close
'ExcelFile FilePath, FileName
Else
Dim tmpPath, objFile2
tmpPath = Mid(FilePath, 1, (Len(FilePath)-Len(FileName)))
FilePath = tmpPath & "Logs\" & FileName
set oFs = server.createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(FilePath, 8, True)
oTextFile.Write Contents
oTextFile.Writeline ""
oTextFile.Close
End If

Set oTextFile = Nothing
Set oFS = Nothing

End Function
Here is one of the example asp code generated:
<% Response.Charset = "UTF-8" %>
<% Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "inline;filename=test.xls"
%>
<html><head><title>Report</title></head><body>
<table cellspacing=0 border="1" width="100%">
<tr height='30'><td bgcolor='YELLOW'> S Survey Id</td></tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%"> SO*****@VIP.SOHU.NET</td>
</tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%"> 123145312</td>
</tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%">
上门服务是没什么可挑剔的,只是电 在出厂时还是要
再严*把关一下,免得双方都浪费宝 时间。上次我们
的那台电脑刚打开就不能运行,后据 修人员讲主板、
显示器都有问题,除*以外,里面的 作系统*本就没
装,连分区都没*式化。后来这一系 都是维修人员装
好的。 </td>
</tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%">
基本上来说在所有的网上保修,我对de ll是最满意的。
有的时候如果不在质保期内dell的收费 有些高。</td>
</tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%">
对政府行业应该随叫随到,这*有利 在政府采**取
得更大的生意。</td>
</tr>
</table></body></html>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

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

Similar topics

3
by: calfdog | last post by:
Hello, I have been doing some experimenting with Automating Internet Explorer for testing. I would like to read from Excel and use the data to set the values of my text boxes on my web forms....
6
by: Chris | last post by:
hi, to convert excel files via csv to xml or whatever I frequently use the csv module which is really nice for quick scripts. problem are of course non ascii characters like german umlauts, EURO...
6
by: dbaldi | last post by:
(this is follow-on message to one posted yesterday) I'm trying to reproduce the capabilities in both Notepad and Excel, whereby a Unicode text file with Unicode characters can be converted to...
2
by: Mike Tammerman | last post by:
Hi, I want to create an Excel file, but I don't to use com or any win32 object. Because, the file should be opened via OpenOffice. I found pyXLWriter, but it doesn't support unicode or non-ascii...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
4
by: thebjorn | last post by:
I'm working with a MS SQL Server database created by a program from a fine US company who seems to have gotten run over by the Unicode truck. In their infinite wisdom they've decided to store...
9
by: Gerry | last post by:
I'm using pyExcelerator and xlrd to read and write data from and to two spreadsheets. I created the "read" spreadsheet by importing a text file - and I had no unicode aspirations. When I read...
2
by: JimmyKoolPantz | last post by:
We purchased som software for encoding a barcode. We want to automate the process of converting a number to a readable barcode. However, I am having a few issues. The file that the barcode...
2
by: KK | last post by:
Hello all, There could be flavors of this question discussed in the past, but I could not really make a head/tail out of it. I have bunch of unicode values stored in a string array and I want to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.