469,938 Members | 2,462 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,938 developers. It's quick & easy.

Manually creating ordered lists - need help

I'm currently run into a snag on one of my projects. We need to create an
ordered list (Mutli levels).

Ie:
1. Some Title
....A....Something here
....B....Something Else
2. Another Title
....A.....I'm here Again
........a....And again.
.............1....One more indent
3..and another

(I don't know if what I typed up there will appear that way... it should)
without the dots.
I have 2 DataTables. One has all the Titles, and the titles that have the
indent. THen I have all the items that go under those titles the other
DataTable.

There are no Child-Parent relations, instead I've used an "Indent" column
(int) that tells me how many times to indent that title, then all items
under that Title will be moved over X amout of pixels.

THe other night I was thinking about using a Recursive loop for this, but
don't know where to start. I'm doing this in C#, and it is being rendered to
PDF so I have some control over how to put the lists.

I can't use HTML.

ANy help would be awesome!

thx.
Oct 17 '05 #1
2 1395
Ryan - how do you know which song goes with the title? Is there a
prohibition for using a relationship for this would certainly make the
problem much easier. You could foreach the Titles, then use GetChildRows
for the songs and easily iterate through this.
"Ryan Ternier" <rt******@icompasstech.com> wrote in message
news:ei**************@TK2MSFTNGP12.phx.gbl...
I'm currently run into a snag on one of my projects. We need to create an
ordered list (Mutli levels).

Ie:
1. Some Title
...A....Something here
...B....Something Else
2. Another Title
...A.....I'm here Again
.......a....And again.
............1....One more indent
3..and another

(I don't know if what I typed up there will appear that way... it should)
without the dots.
I have 2 DataTables. One has all the Titles, and the titles that have the
indent. THen I have all the items that go under those titles the other
DataTable.

There are no Child-Parent relations, instead I've used an "Indent" column
(int) that tells me how many times to indent that title, then all items
under that Title will be moved over X amout of pixels.

THe other night I was thinking about using a Recursive loop for this, but
don't know where to start. I'm doing this in C#, and it is being rendered to PDF so I have some control over how to put the lists.

I can't use HTML.

ANy help would be awesome!

thx.

Oct 18 '05 #2
The Titles Table has a HeaderID field. Each Item also has a HeaderID in it.

Currently I run through 2 for loops to get the current list (which prints
out perfectly, with indenting), I just need to stick the numbers/letters
(bullets) where they need to go.

The GetChildRows would do exactly what I'm doing now. I just don't know how
to do the logic of building the numbering... I have an Idea though:

Recursive Function BuildList(Previous.Indent, Previous.LetterNumberUsed,
bool StartAgain)
{
Do a check to see if this is the Base Number

......Is this row.indent > last row.indent?
.........BuildList(row.indent, row.letter, true)
.....Else
.........AddItem(ItemNameAndInformation, LetterToBeUsed)

}

I think a recursive function would be best, so I'll play around with it.

/RT
"P. Van Den Goess" <Pe**************@leaveoutplease.gmail.com> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
Ryan - how do you know which song goes with the title? Is there a
prohibition for using a relationship for this would certainly make the
problem much easier. You could foreach the Titles, then use GetChildRows
for the songs and easily iterate through this.
"Ryan Ternier" <rt******@icompasstech.com> wrote in message
news:ei**************@TK2MSFTNGP12.phx.gbl...
I'm currently run into a snag on one of my projects. We need to create an
ordered list (Mutli levels).

Ie:
1. Some Title
...A....Something here
...B....Something Else
2. Another Title
...A.....I'm here Again
.......a....And again.
............1....One more indent
3..and another

(I don't know if what I typed up there will appear that way... it should)
without the dots.
I have 2 DataTables. One has all the Titles, and the titles that have the
indent. THen I have all the items that go under those titles the other
DataTable.

There are no Child-Parent relations, instead I've used an "Indent" column
(int) that tells me how many times to indent that title, then all items
under that Title will be moved over X amout of pixels.

THe other night I was thinking about using a Recursive loop for this, but
don't know where to start. I'm doing this in C#, and it is being rendered

to
PDF so I have some control over how to put the lists.

I can't use HTML.

ANy help would be awesome!

thx.


Oct 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

33 posts views Thread by Jim Cobban | last post: by
210 posts views Thread by Christoph Zwerschke | last post: by
2 posts views Thread by Ryan Ternier | last post: by
1 post views Thread by Najib Abi Fadel | last post: by
22 posts views Thread by bearophileHUGS | last post: by
2 posts views Thread by Kirk Strauser | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.