Professional Web Applications Themes

recomendation for how to display data - ASP Database

I am new to asp/ado (I'll be starting with that line for a few months I'm sure!) and I need to learn a good way to display data from a recordset in a nice 'report-like' fashion in Internet Explorer using asp/ado with vbscript. Thus far I have just had to display records from a recordset in a table (every row) and that was easy enough but now I need to make a page look more like a report. I think it will be easiest to ask this by example: recordset fields: User Sale Make Model Price example data: 'jsmith', 'October ...

  1. #1

    Default recomendation for how to display data

    I am new to asp/ado (I'll be starting with that line for a few months I'm
    sure!) and I need to learn a good way to display data from a recordset in a
    nice 'report-like' fashion in Internet Explorer using asp/ado with vbscript.

    Thus far I have just had to display records from a recordset in a table
    (every row) and that was easy enough but now I need to make a page look more
    like a report. I think it will be easiest to ask this by example:

    recordset fields:
    User
    Sale
    Make
    Model
    Price

    example data:
    'jsmith', 'October out', 'HP', 'Laserjet', '850', $100
    'jsmith', 'October out', 'HP', 'Deskjet', '700cse', $75
    'jsmith', 'October out', 'Epson', 'Photo', '1200', $225
    'rlake', 'October out', 'Xerox', 'foofoo', '2112', $350
    'rlake', 'October out', 'Sony', 'Trinitron', 'm70', $75

    The recordset is produced from a particular 'Sale' entered as a parameter by
    the user (via a form) so the 'Sale' will be the same for each record. There
    could be 1 or several records with the same 'User'. Just displaying the
    recordset straight into a table row for row is no good since I don't need to
    display 'October out' every time, or the same username multiple times. I
    would like to group this by 'User'. The 'Sale' (October out) would be
    listed once at the top of the page as a report title. Then under that each
    'User' should be listed once with the items and their prices (Make, Model,
    Price) listed in line-item fashion. At the bottom of each user section I
    would also need to display the total of all the item prices. That part I'm
    sure is easy once I know how to lay this out. It should look something like
    this:

    October out
    Jsmith:
    HP Laserjet 850 $100
    HP Deskjet 700cse $75
    Epson Photo 1200 $225
    Total: $400

    Rlake:
    Xerox foofoo 2112 $350
    Sony Trinitron m70 $75
    Total: $425

    etc.. etc..

    I am afraid If I start thinking to hard I WILL find 'A' way to make this
    happen but since this is new too me and I usually do my homework first so I
    have a good idea of what I'm doing and this time I could not, it will
    probably be an overly complicated and inefficient way! So I'm hoping someone
    can lead me in the write direction?

    ?


    djc Guest

  2. #2

    Default recomendation for how to display data

    What you are wanting is called a control break report. It
    gets its name form the fact that you use a control filed
    to condition your processing. (FWIW I learned this in a DP
    concepts course at the local community college.)

    Here's what you do:
    Determine what fields will be your control breaks from
    major to minor.
    In your example they would probably be:
    Major: Sale
    Minor: user

    Then, sort your data using the control fields, again,
    major to minor:

    ORDER BY sale, User

    Next, declare a variable to hold the value for each
    control field from the previous record.
    When you process a record, compare the value in the
    control field with the value in the field you stored from
    the previous record. If they are the same, you process the
    record as a normal detail line. If they are different, you
    have a control break and you process the record
    accordingly.

    I hope that starts you down the correct road.

    John






    >-----Original Message-----
    >I am new to asp/ado (I'll be starting with that line for
    a few months I'm
    >sure!) and I need to learn a good way to display data
    from a recordset in a
    >nice 'report-like' fashion in Internet Explorer using
    asp/ado with vbscript.
    >
    >Thus far I have just had to display records from a
    recordset in a table
    >(every row) and that was easy enough but now I need to
    make a page look more
    >like a report. I think it will be easiest to ask this by
    example:
    >
    >recordset fields:
    >User
    >Sale
    >Make
    >Model
    >Price
    >
    >example data:
    >'jsmith', 'October out', 'HP', 'Laserjet', '850', $100
    >'jsmith', 'October out', 'HP', 'Deskjet', '700cse',
    $75
    >'jsmith', 'October out', 'Epson', 'Photo', '1200',
    $225
    >'rlake', 'October out', 'Xerox', 'foofoo', '2112',
    $350
    >'rlake', 'October out', 'Sony', 'Trinitron', 'm70',
    $75
    >
    >The recordset is produced from a particular 'Sale'
    entered as a parameter by
    >the user (via a form) so the 'Sale' will be the same for
    each record. There
    >could be 1 or several records with the same 'User'. Just
    displaying the
    >recordset straight into a table row for row is no good
    since I don't need to
    >display 'October out' every time, or the same
    username multiple times. I
    >would like to group this by 'User'. The 'Sale' (October
    out) would be
    >listed once at the top of the page as a report title.
    Then under that each
    >'User' should be listed once with the items and their
    prices (Make, Model,
    >Price) listed in line-item fashion. At the bottom of each
    user section I
    >would also need to display the total of all the item
    prices. That part I'm
    >sure is easy once I know how to lay this out. It should
    look something like
    >this:
    >
    >October out
    >Jsmith:
    >HP Laserjet 850 $100
    >HP Deskjet 700cse $75
    >Epson Photo 1200 $225
    >Total: $400
    >
    >Rlake:
    >Xerox foofoo 2112 $350
    >Sony Trinitron m70 $75
    >Total: $425
    >
    >etc.. etc..
    >
    >I am afraid If I start thinking to hard I WILL find 'A'
    way to make this
    >happen but since this is new too me and I usually do my
    homework first so I
    >have a good idea of what I'm doing and this time I could
    not, it will
    >probably be an overly complicated and inefficient way! So
    I'm hoping someone
    >can lead me in the write direction?
    >
    >?
    >
    >
    >.
    >
    John Beschler Guest

  3. #3

    Default Re: recomendation for how to display data

    wow. I'm smarter than I think I guess. That was pretty much the way I was
    going to proceed but I figured I would be wrong. hehe. : )

    Thanks for the info and the actual technicall name (control break report). I
    do value that kind of info. Thanks!


    "John Beschler" <gilesgeewhiz.com> wrote in message
    news:09f101c39a2a$593b5370$a401280aphx.gbl...
    > What you are wanting is called a control break report. It
    > gets its name form the fact that you use a control filed
    > to condition your processing. (FWIW I learned this in a DP
    > concepts course at the local community college.)
    >
    > Here's what you do:
    > Determine what fields will be your control breaks from
    > major to minor.
    > In your example they would probably be:
    > Major: Sale
    > Minor: user
    >
    > Then, sort your data using the control fields, again,
    > major to minor:
    >
    > ORDER BY sale, User
    >
    > Next, declare a variable to hold the value for each
    > control field from the previous record.
    > When you process a record, compare the value in the
    > control field with the value in the field you stored from
    > the previous record. If they are the same, you process the
    > record as a normal detail line. If they are different, you
    > have a control break and you process the record
    > accordingly.
    >
    > I hope that starts you down the correct road.
    >
    > John
    >
    >
    >
    >
    >
    >
    >
    > >-----Original Message-----
    > >I am new to asp/ado (I'll be starting with that line for
    > a few months I'm
    > >sure!) and I need to learn a good way to display data
    > from a recordset in a
    > >nice 'report-like' fashion in Internet Explorer using
    > asp/ado with vbscript.
    > >
    > >Thus far I have just had to display records from a
    > recordset in a table
    > >(every row) and that was easy enough but now I need to
    > make a page look more
    > >like a report. I think it will be easiest to ask this by
    > example:
    > >
    > >recordset fields:
    > >User
    > >Sale
    > >Make
    > >Model
    > >Price
    > >
    > >example data:
    > >'jsmith', 'October out', 'HP', 'Laserjet', '850', $100
    > >'jsmith', 'October out', 'HP', 'Deskjet', '700cse',
    > $75
    > >'jsmith', 'October out', 'Epson', 'Photo', '1200',
    > $225
    > >'rlake', 'October out', 'Xerox', 'foofoo', '2112',
    > $350
    > >'rlake', 'October out', 'Sony', 'Trinitron', 'm70',
    > $75
    > >
    > >The recordset is produced from a particular 'Sale'
    > entered as a parameter by
    > >the user (via a form) so the 'Sale' will be the same for
    > each record. There
    > >could be 1 or several records with the same 'User'. Just
    > displaying the
    > >recordset straight into a table row for row is no good
    > since I don't need to
    > >display 'October out' every time, or the same
    > username multiple times. I
    > >would like to group this by 'User'. The 'Sale' (October
    > out) would be
    > >listed once at the top of the page as a report title.
    > Then under that each
    > >'User' should be listed once with the items and their
    > prices (Make, Model,
    > >Price) listed in line-item fashion. At the bottom of each
    > user section I
    > >would also need to display the total of all the item
    > prices. That part I'm
    > >sure is easy once I know how to lay this out. It should
    > look something like
    > >this:
    > >
    > >October out
    > >Jsmith:
    > >HP Laserjet 850 $100
    > >HP Deskjet 700cse $75
    > >Epson Photo 1200 $225
    > >Total: $400
    > >
    > >Rlake:
    > >Xerox foofoo 2112 $350
    > >Sony Trinitron m70 $75
    > >Total: $425
    > >
    > >etc.. etc..
    > >
    > >I am afraid If I start thinking to hard I WILL find 'A'
    > way to make this
    > >happen but since this is new too me and I usually do my
    > homework first so I
    > >have a good idea of what I'm doing and this time I could
    > not, it will
    > >probably be an overly complicated and inefficient way! So
    > I'm hoping someone
    > >can lead me in the write direction?
    > >
    > >?
    > >
    > >
    > >.
    > >

    djc Guest

Similar Threads

  1. display data points but not data tips
    By ahatl123 in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 30th, 07:17 AM
  2. How to display a set of data in a data grid when drivenby a combo box?
    By Si Fi in forum Macromedia Flash Data Integration
    Replies: 5
    Last Post: August 16th, 05:03 PM
  3. Book Recomendation
    By SamMan in forum PHP Development
    Replies: 0
    Last Post: January 24th, 07:15 PM
  4. Need Help on Recomendation
    By Jayme Berry in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 13
    Last Post: August 9th, 06:16 AM
  5. Replies: 1
    Last Post: July 23rd, 05:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139