Report Generator

P

Paulo

I need a report generator... I think it's cool the own user select the
columns he/she wants to display... Have you seen anything?

Maybe a SilverLight with asp.net or classic asp (I dont know if SL can be
used with classic asp...) Can you suggest me something?

THanks
 
A

Adrienne Boswell

I need a report generator... I think it's cool the own user select the
columns he/she wants to display... Have you seen anything?

Maybe a SilverLight with asp.net or classic asp (I dont know if SL can
be used with classic asp...) Can you suggest me something?

THanks

It depends on what kind of database you have on the backend. Basically,
what you would want to do is show a list of columns with input checkbox
markup, submit that form to itself, and on post, get the columns, run
the query and present it to the user.

<%
if request.servervariables("Request_Method") = "POST" then
hasselected = true
columns = request.form("column")
sql = "SELECT " & columns & " FROM table "
if(request.form("whereclause") <> "" then
sql = sql & " WHERE " & whereclause
end if
set rs = createobject("ADODB.Recordset")
rs.open sql, connectiontodb
rsarr = rs.getrows()
rs.close
set rs = nothing
else
'query to get the column names into a recordet
hasselected = false
set rs = createobject("ADODB.Recordset")
rs.open sql, connectiontodb
colsarr = rs.getrows()
rs.close
set rs = nothing
end if
%>
<% if not hasselected then %>
<form method="post" action="<%=request.servervariables
("SCRIPT_NAME")%>">
<label for="columns">Select Columns</label>
<% for i = 0 to unbound(colsarr,2)%>
<input type="checkbox" id="columns<%=i%>" name="column" value="<%
=colsarr(0,i)"%>"><%=colsarr(0,i)%><br>
<% next%>
<input type="submit" value="Submit">
</form>
<% else %>
<p>The results of your query are:</p>
<% 'loop through the rsarr array to show the results of the
query%>
<% end if%>
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top