Report Generator

Discussion in 'ASP General' started by Paulo, Jul 7, 2009.

  1. Paulo

    Paulo Guest

    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
    Paulo, Jul 7, 2009
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed "Paulo" <>
    writing in news:u#RNiGx$:

    > 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%>





    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Jul 7, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin Maurer
    Replies:
    3
    Views:
    4,838
    Peter
    Apr 19, 2006
  2. TheDustbustr
    Replies:
    1
    Views:
    448
    Sami Hangaslammi
    Jul 25, 2003
  3. Replies:
    9
    Views:
    539
  4. Chris Withers

    Problems with email.Generator.Generator

    Chris Withers, Sep 11, 2006, in forum: Python
    Replies:
    20
    Views:
    1,693
    Max M
    Sep 12, 2006
  5. Terry Reedy

    Generator functions subclass generator?

    Terry Reedy, Jun 18, 2009, in forum: Python
    Replies:
    0
    Views:
    459
    Terry Reedy
    Jun 18, 2009
Loading...

Share This Page