Ask a Question related to ASP Database, Design and Development.
-
djc #1
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 Blowout', 'HP', 'Laserjet', '850', $100
'jsmith', 'October Blowout', 'HP', 'Deskjet', '700cse', $75
'jsmith', 'October Blowout', 'Epson', 'Photo', '1200', $225
'rlake', 'October Blowout', 'Xerox', 'foofoo', '2112', $350
'rlake', 'October Blowout', '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 Blowout' every time, or the same username multiple times. I
would like to group this by 'User'. The 'Sale' (October Blowout) 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 Blowout
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
-
How to display a set of data in a data grid when drivenby a combo box?
I am trying to build a page where the user can select a syle of food (i.e. chinese, italian etc) from a combo. I would then want the relevent... -
Graphics control recomendation, please
I have the need to create thumbnails on the fly and do some other image manipulation that is form based. I download and installed the free GflAx... -
Book Recomendation
I'm sure that this has been asked countless times on this group (as it undoubtedly is on others)... I am looking for a good beginners PHP book... -
Need Help on Recomendation
I am a graphics/website developer. Does anyone have a recommendation on what the best graphics card is. I am getting a new computer and want to load... -
Display data from database in a scrollable data grid on an ASP Page
Hi All, I want to display data from database in a scrollable data grid on an ASP Page. I want to use it for entering data also. Should i have to... -
John Beschler #2
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
a few months I'm>-----Original Message-----
>I am new to asp/ado (I'll be starting with that line forfrom a recordset in a>sure!) and I need to learn a good way to display dataasp/ado with vbscript.>nice 'report-like' fashion in Internet Explorer usingrecordset in a table>
>Thus far I have just had to display records from amake a page look more>(every row) and that was easy enough but now I need toexample:>like a report. I think it will be easiest to ask this by$75>
>recordset fields:
>User
>Sale
>Make
>Model
>Price
>
>example data:
>'jsmith', 'October Blowout', 'HP', 'Laserjet', '850', $100
>'jsmith', 'October Blowout', 'HP', 'Deskjet', '700cse',$225>'jsmith', 'October Blowout', 'Epson', 'Photo', '1200',$350>'rlake', 'October Blowout', 'Xerox', 'foofoo', '2112',$75>'rlake', 'October Blowout', 'Sony', 'Trinitron', 'm70',entered as a parameter by>
>The recordset is produced from a particular 'Sale'each record. There>the user (via a form) so the 'Sale' will be the same fordisplaying the>could be 1 or several records with the same 'User'. Justsince I don't need to>recordset straight into a table row for row is no goodusername multiple times. I>display 'October Blowout' every time, or the sameBlowout) would be>would like to group this by 'User'. The 'Sale' (OctoberThen under that each>listed once at the top of the page as a report title.prices (Make, Model,>'User' should be listed once with the items and theiruser section I>Price) listed in line-item fashion. At the bottom of eachprices. That part I'm>would also need to display the total of all the itemlook something like>sure is easy once I know how to lay this out. It shouldway to make this>this:
>
>October Blowout
>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'homework first so I>happen but since this is new too me and I usually do mynot, it will>have a good idea of what I'm doing and this time I couldI'm hoping someone>probably be an overly complicated and inefficient way! So>can lead me in the write direction?
>
>?
>
>
>.
>John Beschler Guest
-
djc #3
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" <giles@geewhiz.com> wrote in message
news:09f101c39a2a$593b5370$a401280a@phx.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
>
>
>
>
>
>
>> a few months I'm> >-----Original Message-----
> >I am new to asp/ado (I'll be starting with that line for> from a recordset in a> >sure!) and I need to learn a good way to display data> asp/ado with vbscript.> >nice 'report-like' fashion in Internet Explorer using> recordset in a table> >
> >Thus far I have just had to display records from a> make a page look more> >(every row) and that was easy enough but now I need to> example:> >like a report. I think it will be easiest to ask this by> $75> >
> >recordset fields:
> >User
> >Sale
> >Make
> >Model
> >Price
> >
> >example data:
> >'jsmith', 'October Blowout', 'HP', 'Laserjet', '850', $100
> >'jsmith', 'October Blowout', 'HP', 'Deskjet', '700cse',> $225> >'jsmith', 'October Blowout', 'Epson', 'Photo', '1200',> $350> >'rlake', 'October Blowout', 'Xerox', 'foofoo', '2112',> $75> >'rlake', 'October Blowout', 'Sony', 'Trinitron', 'm70',> entered as a parameter by> >
> >The recordset is produced from a particular 'Sale'> each record. There> >the user (via a form) so the 'Sale' will be the same for> displaying the> >could be 1 or several records with the same 'User'. Just> since I don't need to> >recordset straight into a table row for row is no good> username multiple times. I> >display 'October Blowout' every time, or the same> Blowout) would be> >would like to group this by 'User'. The 'Sale' (October> Then under that each> >listed once at the top of the page as a report title.> prices (Make, Model,> >'User' should be listed once with the items and their> user section I> >Price) listed in line-item fashion. At the bottom of each> prices. That part I'm> >would also need to display the total of all the item> look something like> >sure is easy once I know how to lay this out. It should> way to make this> >this:
> >
> >October Blowout
> >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'> homework first so I> >happen but since this is new too me and I usually do my> not, it will> >have a good idea of what I'm doing and this time I could> I'm hoping someone> >probably be an overly complicated and inefficient way! So> >can lead me in the write direction?
> >
> >?
> >
> >
> >.
> >
djc Guest



Reply With Quote

