Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > displaying data in columns

Reply
Thread Tools

displaying data in columns

 
 
Jennifer Smith
Guest
Posts: n/a
 
      09-17-2004
I want to be able to display my recordset as follows:

a e
b f
c g
d h

Instead of :
a b
c d
e f
g h

Any links to some examples?

 
Reply With Quote
 
 
 
 
Mark Schupp
Guest
Posts: n/a
 
      09-17-2004
Do you need each piece of data in its own cell?

If not

<tr>
<td>
list the first column here using <br> or <p> for line breaks
</td>
<td>
list the second column here using <br> or <p> for line breaks
</td>
</tr>

If you do need separate cells put the data into an array (maybe with
GetRows()) and grab the element you need as you generate the table cells.


--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Jennifer Smith" <> wrote in message
news:...
> I want to be able to display my recordset as follows:
>
> a e
> b f
> c g
> d h
>
> Instead of :
> a b
> c d
> e f
> g h
>
> Any links to some examples?
>



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-17-2004
Jennifer Smith wrote:
> I want to be able to display my recordset as follows:
>
> a e
> b f
> c g
> d h
>
> Instead of :
> a b
> c d
> e f
> g h
>
> Any links to some examples?


Does this recordset contain two fields? Or does each letter in your example
represent a row in the recordset?

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
Jennifer Smith
Guest
Posts: n/a
 
      09-17-2004
Sorry each letter represents a field.

I need to order my data alphabetically in columns.

For example - I return a recordset of a, b, c, d

I would want to display like this:
col 1 col2
a c
c d

Thanks

"Bob Barrows [MVP]" wrote:

> Jennifer Smith wrote:
> > I want to be able to display my recordset as follows:
> >
> > a e
> > b f
> > c g
> > d h
> >
> > Instead of :
> > a b
> > c d
> > e f
> > g h
> >
> > Any links to some examples?

>
> Does this recordset contain two fields? Or does each letter in your example
> represent a row in the recordset?
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-17-2004
I'm sorry, I'm still not clear about what your recordset contains. Is it 4
rows, each row containing a letter?

field1
a
b
c
d

Or is it 2 rows, each row containing two fields?

field1 field2
a b
c d

Perhaps if you showed us the SQL statement used to generate the recordset,
all would become clear.

Bob Barrows
Jennifer Smith wrote:
> Sorry each letter represents a field.
>
> I need to order my data alphabetically in columns.
>
> For example - I return a recordset of a, b, c, d
>
> I would want to display like this:
> col 1 col2
> a c
> c d
>
> Thanks
>
> "Bob Barrows [MVP]" wrote:
>
>> Jennifer Smith wrote:
>>> I want to be able to display my recordset as follows:
>>>
>>> a e
>>> b f
>>> c g
>>> d h
>>>
>>> Instead of :
>>> a b
>>> c d
>>> e f
>>> g h
>>>
>>> Any links to some examples?

>>
>> Does this recordset contain two fields? Or does each letter in your
>> example represent a row in the recordset?
>>
>> Bob Barrows
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
Jennifer Smith
Guest
Posts: n/a
 
      09-17-2004
Sorry I wasn't more clear. It is 4 rows each containing a letter. So 4
records returned.


"Bob Barrows [MVP]" wrote:

> I'm sorry, I'm still not clear about what your recordset contains. Is it 4
> rows, each row containing a letter?
>
> field1
> a
> b
> c
> d
>
> Or is it 2 rows, each row containing two fields?
>
> field1 field2
> a b
> c d
>
> Perhaps if you showed us the SQL statement used to generate the recordset,
> all would become clear.
>
> Bob Barrows
> Jennifer Smith wrote:
> > Sorry each letter represents a field.
> >
> > I need to order my data alphabetically in columns.
> >
> > For example - I return a recordset of a, b, c, d
> >
> > I would want to display like this:
> > col 1 col2
> > a c
> > c d
> >
> > Thanks
> >
> > "Bob Barrows [MVP]" wrote:
> >
> >> Jennifer Smith wrote:
> >>> I want to be able to display my recordset as follows:
> >>>
> >>> a e
> >>> b f
> >>> c g
> >>> d h
> >>>
> >>> Instead of :
> >>> a b
> >>> c d
> >>> e f
> >>> g h
> >>>
> >>> Any links to some examples?
> >>
> >> Does this recordset contain two fields? Or does each letter in your
> >> example represent a row in the recordset?
> >>
> >> Bob Barrows
> >> --
> >> Microsoft MVP -- ASP/ASP.NET
> >> Please reply to the newsgroup. The email account listed in my From
> >> header is my spam trap, so I don't check it very often. You will get
> >> a quicker response by posting to the newsgroup.

>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      09-17-2004
I would do something like what Mark said (this is untested and may need to
be tweaked):

'open the recordset, then
arData = rs.GetRows
rs.close:set rs=nothing
cn.close:set cn = nothing

if isarray(arData) then
'assuming <table> tags are already in place
for i = 0 to ubound(arData,2)
if i mod 2 = 1 then '(if it's an even numbered row)
response.write "<td>" & arData(0,i) & "</td></tr>"
else
response.write "<tr><td>" & arData(0,i) & "</td>"
end if
next
if ubound(arData,2) mod 2 = 0 then
response.write "<td></td></tr>"
end if
else
'handle situation where no data was returned
end if


Jennifer Smith wrote:
> Sorry I wasn't more clear. It is 4 rows each containing a letter.
> So 4 records returned.
>
>
> "Bob Barrows [MVP]" wrote:
>
>> I'm sorry, I'm still not clear about what your recordset contains.
>> Is it 4 rows, each row containing a letter?
>>
>> field1
>> a
>> b
>> c
>> d
>>
>> Or is it 2 rows, each row containing two fields?
>>
>> field1 field2
>> a b
>> c d
>>
>> Perhaps if you showed us the SQL statement used to generate the
>> recordset, all would become clear.
>>
>> Bob Barrows
>> Jennifer Smith wrote:
>>> Sorry each letter represents a field.
>>>
>>> I need to order my data alphabetically in columns.
>>>
>>> For example - I return a recordset of a, b, c, d
>>>
>>> I would want to display like this:
>>> col 1 col2
>>> a c
>>> c d
>>>
>>> Thanks
>>>
>>> "Bob Barrows [MVP]" wrote:
>>>
>>>> Jennifer Smith wrote:
>>>>> I want to be able to display my recordset as follows:
>>>>>
>>>>> a e
>>>>> b f
>>>>> c g
>>>>> d h
>>>>>
>>>>> Instead of :
>>>>> a b
>>>>> c d
>>>>> e f
>>>>> g h
>>>>>
>>>>> Any links to some examples?
>>>>
>>>> Does this recordset contain two fields? Or does each letter in your
>>>> example represent a row in the recordset?
>>>>
>>>> Bob Barrows
>>>> --
>>>> Microsoft MVP -- ASP/ASP.NET
>>>> Please reply to the newsgroup. The email account listed in my From
>>>> header is my spam trap, so I don't check it very often. You will
>>>> get
>>>> a quicker response by posting to the newsgroup.

>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Align table columns with gridview columns Jacksm ASP .Net 2 11-21-2006 09:49 PM
Read CSV - string Columns - Int columns =?Utf-8?B?YmVub2l0?= ASP .Net 0 05-08-2006 02:11 PM
database columns vs. gui columns and sorting ittay.dror@gmail.com Java 5 03-04-2006 10:48 AM
CSS columns problem - faux columns don't work henrybranson@hotmail.com HTML 4 11-24-2005 10:05 AM
convert rows to columns and columns to rows helpful sql ASP .Net 0 05-19-2005 06:03 PM



Advertisments
 



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