Click here to Skip to main content
15,890,123 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
GeneralRe: How to use a windows user control in an aspx page Pin
Smitha Appukuttan4-Apr-07 0:28
Smitha Appukuttan4-Apr-07 0:28 
GeneralRe: How to use a windows user control in an aspx page Pin
Sathesh Sakthivel4-Apr-07 0:48
Sathesh Sakthivel4-Apr-07 0:48 
GeneralRe: How to use a windows user control in an aspx page Pin
Smitha Appukuttan4-Apr-07 1:01
Smitha Appukuttan4-Apr-07 1:01 
QuestionProblem in handling events of Usercontrol Pin
aeku3-Apr-07 23:44
aeku3-Apr-07 23:44 
AnswerRe: Problem in handling events of Usercontrol Pin
Smitha Appukuttan3-Apr-07 23:52
Smitha Appukuttan3-Apr-07 23:52 
Questiondata type conversion Pin
neodeaths3-Apr-07 21:49
neodeaths3-Apr-07 21:49 
AnswerRe: data type conversion Pin
enjoycrack3-Apr-07 21:51
enjoycrack3-Apr-07 21:51 
AnswerRe: data type conversion Pin
N a v a n e e t h3-Apr-07 22:50
N a v a n e e t h3-Apr-07 22:50 
GeneralRe: data type conversion Pin
ASPDevelopper12348754-Apr-07 0:33
ASPDevelopper12348754-Apr-07 0:33 
GeneralRe: data type conversion Pin
ASPDevelopper12348754-Apr-07 0:34
ASPDevelopper12348754-Apr-07 0:34 
Questionurl in action Pin
iamdking3-Apr-07 21:34
iamdking3-Apr-07 21:34 
AnswerRe: url in action Pin
enjoycrack3-Apr-07 21:37
enjoycrack3-Apr-07 21:37 
GeneralRe: url in action Pin
iamdking3-Apr-07 22:09
iamdking3-Apr-07 22:09 
AnswerRe: url in action Pin
N a v a n e e t h3-Apr-07 22:48
N a v a n e e t h3-Apr-07 22:48 
GeneralRe: url in action Pin
iamdking4-Apr-07 2:36
iamdking4-Apr-07 2:36 

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.