Not able to display html contents in ASP Page

V

vallurys

Hello!


I have this HTML content in my sub WriteData, which is called by
passing office,fy and month details which will create a worksheet for
me.

This is not working for me.

Please tell me whats wrong in the code.


Regards
Vallury


<%@ Language=VBScript %>
<!--#INCLUDE FILE = "ConnectionMR.inc" -->
<%
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Set DataRst = Server.CreateObject("ADODB.Recordset")
Dim objWorkbook, c, objSheet1, objSheet2, objSheet3, intCol, intRow

Set objWorkbook = CreateObject("OWC10.Spreadsheet")
Set c = objWorkbook.Constants



Set objSheet1 = objWorkbook.Worksheets(1)
objSheet1.Name = "India"
Set objSheet2 = objWorkbook.Worksheets(2)
objSheet2.Name = "Singapore"

Set objSheet3 = objWorkbook.Worksheets(3)
objSheet3.Name = "Palo Alto"


objSheet1.Activate
call WriteData("AP-IND","2004","OCT")

objSheet2.Activate
call WriteData("US","2004","OCT")

objSheet3.Activate
call WriteData "AP-IND","2004","OCT"


objWorkbook.DisplayToolbar = False
objWorkbook.AutoFit = True
objSheet1.Activate

Response.Write objWorkbook.XMLData
'Response.End

Set objWorkbook = Nothing
Set c = Nothing
Set objSheet1 = Nothing
Set objSheet2 = Nothing
Set objSheet3 = Nothing

sub WriteData(office,finyear,mon)
With objWorkbook.ActiveSheet

Str="Select Count(*) from SalesOrders where
FinancialYear='"+trim(finyear)+"' and Months='"+mon+"'"
DataRst.Open Str, DataConn
perc1 = cstr(DataRst(0))
DataRst.Close
if perc1=0 then
response.write("<br><br><br><br><center><table width=550 border=1
cellpadding=0 cellspacing=0 bgcolor=#FFE2D5 bordercolor=#FFC1A4>")
response.write("<tr><td align=center><font size=4 face=Batang
color=#400000>No Data Exists For Financial Year - " & finyear &" and
Month - " & mon &"</font></td></tr></table>")
response.end
end if

RptData="<table border=1 bordercolor=#596673 cellspacing=0
cellpadding=0><tr bgcolor=#596673><td colspan=9 align=center><font
color=#FFFFFF><b>Summary Report for Region - " & region & ", Office - "
& office & ", Month - " & mon & " and FinancialYear - " & finyear &
"</b></font></td></tr><tr bgcolor=#798F97><td align=center><font
color=#FFFFCC>Available Efficiency Feature</font></td><td
align=center><font color=#FFFFCC>Total
Transacations/month</font></td><td align=center><font
color=#FFFFCC>Efficiency Tool</font></td><td align=center
bgcolor=#99FFCC><font color=#663300>Type of measure</font></td><td
align=center bgcolor=#FFFFCC><font color=#663300>Transactions using
efficiency tool</font></td><td align=center><font color=#FFFFCC>% of
Total transactions</font></td><td align=center><font color=#FFFFCC>Avg.
saving/transaction</font></td><td align=center><font color=#FFFFCC>Tot.
Minutes saved</font></td><td align=center><font
color=#FFFFCC>Comments</font></td></tr>"

Str="Select Count(SoNo) from SalesOrders where
description='"+trim(office)+"' and FinancialYear='"+trim(finyear)+"'
and Months='"+mon+"'"
DataRst.Open Str, DataConn
if DataRst.eof=false then
perc1 = cstr(DataRst(0))
else
perc1 = 0
end if
DataRst.Close

Str="Select Count(SoNo) from SalesOrders where
description='"+trim(office)+"' and FinancialYear='"+trim(finyear)+"'
and Months='"+mon+"' and origin='"+"EDI/Batchn"+"'"
DataRst.Open Str, DataConn
if DataRst.eof=false then
perc2 =cstr(DataRst(0))
else
perc2 = 0
end if
DataRst.Close


'response.write rptdata
'.Columns("A:D").AutoFilter
End With
End sub



%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top