Click here to Skip to main content
15,912,756 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Declaring a javascript function Pin
Not Active4-Apr-07 3:46
mentorNot Active4-Apr-07 3:46 
GeneralRe: Declaring a javascript function Pin
kubben4-Apr-07 3:48
kubben4-Apr-07 3:48 
AnswerRe: Declaring a javascript function Pin
Not Active4-Apr-07 3:42
mentorNot Active4-Apr-07 3:42 
GeneralRe: Declaring a javascript function Pin
Alice@mywonderland4-Apr-07 4:17
Alice@mywonderland4-Apr-07 4:17 
GeneralRe: Declaring a javascript function Pin
Not Active4-Apr-07 4:34
mentorNot Active4-Apr-07 4:34 
GeneralRe: Declaring a javascript function Pin
Alice@mywonderland4-Apr-07 5:21
Alice@mywonderland4-Apr-07 5:21 
GeneralRe: Declaring a javascript function Pin
Not Active4-Apr-07 5:27
mentorNot Active4-Apr-07 5:27 
GeneralRe: Declaring a javascript function Pin
Alice@mywonderland4-Apr-07 5:51
Alice@mywonderland4-Apr-07 5:51 
GeneralRe: Declaring a javascript function Pin
Not Active4-Apr-07 6:12
mentorNot Active4-Apr-07 6:12 
AnswerRe: Declaring a javascript function Pin
Guffa4-Apr-07 5:15
Guffa4-Apr-07 5:15 
Questionregisteration for MSDN Subscriptions Pin
siddisagar4-Apr-07 2:22
siddisagar4-Apr-07 2:22 
QuestionIssues in Word Automation [modified] Pin
Jijesh.V.R4-Apr-07 1:52
Jijesh.V.R4-Apr-07 1:52 
QuestionHow to make servers masterpage or main page for multiple applications Pin
Lappalainen Antti4-Apr-07 1:47
Lappalainen Antti4-Apr-07 1:47 
Question.Net 2.0 - Calling Page method from User control or Master Page Pin
shyamts4-Apr-07 1:12
shyamts4-Apr-07 1:12 
AnswerRe: .Net 2.0 - Calling Page method from User control or Master Page Pin
Not Active4-Apr-07 3:38
mentorNot Active4-Apr-07 3:38 
Questionurgent "Div Control" Pin
jayarajmrj4-Apr-07 0:42
jayarajmrj4-Apr-07 0:42 
AnswerRe: urgent "Div Control" Pin
Paddy Boyd4-Apr-07 0:46
Paddy Boyd4-Apr-07 0:46 
GeneralRe: urgent "Div Control" [modified] Pin
jayarajmrj4-Apr-07 0:52
jayarajmrj4-Apr-07 0:52 
GeneralRe: urgent "Div Control" Pin
Paddy Boyd4-Apr-07 1:15
Paddy Boyd4-Apr-07 1:15 
GeneralRe: urgent "Div Control" Pin
Paddy Boyd4-Apr-07 1:16
Paddy Boyd4-Apr-07 1:16 
QuestionControls are not working fine in Mozilla Pin
Kushi Bobby4-Apr-07 0:36
Kushi Bobby4-Apr-07 0:36 
QuestionWeb Service Security Pin
lokeshgupta134-Apr-07 0:32
lokeshgupta134-Apr-07 0:32 
Questionexport to excel Pin
mayurpix4-Apr-07 0:25
mayurpix4-Apr-07 0:25 
Hi there ,
Can anyone help me out!!

I have a report (basically retrieving of records from the database and show it in a htm table format)
which is displayed on the browser as htm table..
Now my problem comes here..
I was asked to program such that the report is shown in excel rather than as html table..
with great enthusiasm I started working only to find out i am not able to do..



Pls help me out!!

I am posting my code here :

<html>
<head>
<title>Result of Database Query</title>
</head>
<body>
<h1>Result of Database Query</h1>
<%
set myconn = server.createobject("adodb.connection")
connection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("g1.mdb")
myconn.open (connection)
set result = server.createobject("adodb.recordset")
sql = "SELECT * FROM tblComments1 WHERE Field2 Like '" & request("device") & "%' and Field8 Like '" & request("status") & "%'"
set result = myconn.execute(sql)
if not result.EOF then
response.write("<p>Data for " & request("place"))
response.write("<table border=2><tr><th>Device Group<th>Device Name<th>Interface name<th>Type<th>Description<th>Duplex<th>VLAN<th>Status<th>Speed<th>Security")
while not result.EOF

response.write("<tr font size=5><td>" & result("Field1"))
response.write("<td>" & result("Field2"))
response.write("<td>" & result("Field3"))
response.write("<td>" & result("Field4"))
response.write("<td>" & result("Field5"))
response.write("<td>" & result("Field6"))
response.write("<td>" & result("Field7"))
response.write("<td>" & result("Field8"))
response.write("<td>" & result("Field9"))
response.write("<td>" & result("Field10"))
result.movenext()
wend
response.write("</table>")
else
response.write("<p>No Entry for " & request("place"))
end if
%>
<%
sExport = Request.QueryString("export") ' Load Export Request
If sExport = "excel" Then
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=" & ewTblVar & ".xls"
End If
%>
</p>
</body>
</html>

max
QuestionHow to use a windows user control in an aspx page Pin
Smitha Appukuttan3-Apr-07 23:46
Smitha Appukuttan3-Apr-07 23:46 
AnswerRe: How to use a windows user control in an aspx page Pin
Sathesh Sakthivel4-Apr-07 0:05
Sathesh Sakthivel4-Apr-07 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.