R
Renato Lopes
Hello all!
i'm very new in this, and i'm having a problem with unicode:
the page displays correctly in the browser but i just can´t set it up
to correctly display caracters like "cão hábitos histórico"
Later on i manage to see some help and try to include the "ISO-8859-1"
statement, but i'm having errors.
Let me show the code:
<!--#include file="../../comum/db.inc"-->
<%
id_p=request.querystring("id_project")
id_pkg=request.querystring("id_pkg")
smenu=request.querystring("smenu")
SQLtmt="SELECT * from items"
set rs=myconn.execute(sqltmt)
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
'Response.ContentType = "text/xml"
%>
<?xml version="1.0" encoding="iso-8859-1" ?>
<%
response.charset="ISO-8859-1"
Set oSS = CreateObject("OWC11.Spreadsheet")
Set c = oSS.Constants
Set oOrdersSheet = oSS.Worksheets(1)
oOrdersSheet.Name = "Mapa de Quantidades"
oSS.Worksheets(2).Delete
oSS.Worksheets(2).Delete
Set oRange = oOrdersSheet.Range("B22")
oRange.merge
oRange.Value = rs("pkgcode") & "-" & rs("pkgname")
oRange.Font.Bold = True
oRange.font.color = "white"
oRange.Interior.Color = "Navy"
oRange.Borders(c.xlEdgeBottom).Weight = c.xlThick
oRange.HorizontalAlignment = c.xlHAlignCenter
Set oRange = oOrdersSheet.Range("B44")
oRange.merge
oRange.Value = rs("pkgdes1")
oRange.Font.Bold = True
oRange.font.color = "white"
oRange.Interior.Color = "Navy"
oRange.Borders(c.xlEdgeBottom).Weight = c.xlThick
oRange.HorizontalAlignment = c.xlHAlignCenter
Set oRange = oOrdersSheet.Range("B66")
oRange.Value = Array("Item", "Designacao", "Quantidade")
oRange.Font.Bold = True
oRange.Interior.Color = "Silver"
oRange.Borders(c.xlEdgeBottom).Weight = c.xlThick
oRange.HorizontalAlignment = c.xlHAlignCenter
'Apply formatting to the columns
oOrdersSheet.Range("A:A").ColumnWidth = 5
oOrdersSheet.Range("B:B").ColumnWidth = 15
oOrdersSheet.Range("C:C").ColumnWidth = 35
oOrdersSheet.Range("D").ColumnWidth = 15
'Obtain the order information for the first five columns in the
Orders worksheet
'and populate the worksheet with that data starting at row 2
redim aOrderData(600,3)
reg=0
while not rs.eof
aOrderData(reg,0) = rs("contractitem")
aOrderData(reg,1) = rs("cunitdes1")
aOrderData(reg,2) = rs("contractqty")
rs.movenext
reg=reg+1
wend
oOrdersSheet.Range("B7" & reg + 7).Value = aOrderData
'Apply window settings for the Orders worksheet
oOrdersSheet.Activate 'Makes the Orders sheet active
'oSS.Windows(1).ViewableRange = oOrdersSheet.UsedRange.Address
oSS.Windows(1).DisplayRowHeadings = true
oSS.Windows(1).DisplayColumnHeadings = true
oSS.Windows(1).FreezePanes = false
oSS.Windows(1).DisplayGridlines = true
'=== Setup for final presentation
==================================================
oSS.DisplayToolbar = true
oSS.AutoFit = false
oOrdersSheet.Activate
Response.Write oSS.XMLData
Response.End
%>
****** END OF CODE *******
when i try to view in the browser gives an error, but if i remove the
line " <?xml version="1.0" encoding="iso-8859-1" ?>" then if works
fine, but without the characters.
Finaly i went into the outputed xml file and i notice that at the
benining was something like this:
<?xml version="1.0" ?>
<?xml version="1.0" encoding="iso-8859-1" ?>
<ss:Workbook xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet"
xmlns:c="urn:schemas-microsoft-comffice:component:spreadsheet">
.... etc...
And if i remove the first line (that is automaticaly added) then the
result is perfect when loaded in excel 2003!!!
sorry for this enormous statement, but please help!!
best regards,
Renato.
Portugal
i'm very new in this, and i'm having a problem with unicode:
the page displays correctly in the browser but i just can´t set it up
to correctly display caracters like "cão hábitos histórico"
Later on i manage to see some help and try to include the "ISO-8859-1"
statement, but i'm having errors.
Let me show the code:
<!--#include file="../../comum/db.inc"-->
<%
id_p=request.querystring("id_project")
id_pkg=request.querystring("id_pkg")
smenu=request.querystring("smenu")
SQLtmt="SELECT * from items"
set rs=myconn.execute(sqltmt)
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
'Response.ContentType = "text/xml"
%>
<?xml version="1.0" encoding="iso-8859-1" ?>
<%
response.charset="ISO-8859-1"
Set oSS = CreateObject("OWC11.Spreadsheet")
Set c = oSS.Constants
Set oOrdersSheet = oSS.Worksheets(1)
oOrdersSheet.Name = "Mapa de Quantidades"
oSS.Worksheets(2).Delete
oSS.Worksheets(2).Delete
Set oRange = oOrdersSheet.Range("B22")
oRange.merge
oRange.Value = rs("pkgcode") & "-" & rs("pkgname")
oRange.Font.Bold = True
oRange.font.color = "white"
oRange.Interior.Color = "Navy"
oRange.Borders(c.xlEdgeBottom).Weight = c.xlThick
oRange.HorizontalAlignment = c.xlHAlignCenter
Set oRange = oOrdersSheet.Range("B44")
oRange.merge
oRange.Value = rs("pkgdes1")
oRange.Font.Bold = True
oRange.font.color = "white"
oRange.Interior.Color = "Navy"
oRange.Borders(c.xlEdgeBottom).Weight = c.xlThick
oRange.HorizontalAlignment = c.xlHAlignCenter
Set oRange = oOrdersSheet.Range("B66")
oRange.Value = Array("Item", "Designacao", "Quantidade")
oRange.Font.Bold = True
oRange.Interior.Color = "Silver"
oRange.Borders(c.xlEdgeBottom).Weight = c.xlThick
oRange.HorizontalAlignment = c.xlHAlignCenter
'Apply formatting to the columns
oOrdersSheet.Range("A:A").ColumnWidth = 5
oOrdersSheet.Range("B:B").ColumnWidth = 15
oOrdersSheet.Range("C:C").ColumnWidth = 35
oOrdersSheet.Range("D").ColumnWidth = 15
'Obtain the order information for the first five columns in the
Orders worksheet
'and populate the worksheet with that data starting at row 2
redim aOrderData(600,3)
reg=0
while not rs.eof
aOrderData(reg,0) = rs("contractitem")
aOrderData(reg,1) = rs("cunitdes1")
aOrderData(reg,2) = rs("contractqty")
rs.movenext
reg=reg+1
wend
oOrdersSheet.Range("B7" & reg + 7).Value = aOrderData
'Apply window settings for the Orders worksheet
oOrdersSheet.Activate 'Makes the Orders sheet active
'oSS.Windows(1).ViewableRange = oOrdersSheet.UsedRange.Address
oSS.Windows(1).DisplayRowHeadings = true
oSS.Windows(1).DisplayColumnHeadings = true
oSS.Windows(1).FreezePanes = false
oSS.Windows(1).DisplayGridlines = true
'=== Setup for final presentation
==================================================
oSS.DisplayToolbar = true
oSS.AutoFit = false
oOrdersSheet.Activate
Response.Write oSS.XMLData
Response.End
%>
****** END OF CODE *******
when i try to view in the browser gives an error, but if i remove the
line " <?xml version="1.0" encoding="iso-8859-1" ?>" then if works
fine, but without the characters.
Finaly i went into the outputed xml file and i notice that at the
benining was something like this:
<?xml version="1.0" ?>
<?xml version="1.0" encoding="iso-8859-1" ?>
<ss:Workbook xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet"
xmlns:c="urn:schemas-microsoft-comffice:component:spreadsheet">
.... etc...
And if i remove the first line (that is automaticaly added) then the
result is perfect when loaded in excel 2003!!!
sorry for this enormous statement, but please help!!
best regards,
Renato.
Portugal