Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 17th, 2005, 06:03 PM
rternier's Avatar
rternier rternier is offline
Dev Shed Ninja
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2005
Location: British Columbia, CANADA!
Posts: 553 rternier User rank is Sergeant Major (2000 - 5000 Reputation Level)rternier User rank is Sergeant Major (2000 - 5000 Reputation Level)rternier User rank is Sergeant Major (2000 - 5000 Reputation Level)rternier User rank is Sergeant Major (2000 - 5000 Reputation Level)rternier User rank is Sergeant Major (2000 - 5000 Reputation Level)rternier User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 6 Days 22 h 1 m 35 sec
Reputation Power: 28
Send a message via MSN to rternier
Creating an ORdered List (NOT useing HTML)

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

Ie:

Code:
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 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!

Reply With Quote
  #2  
Old November 8th, 2005, 09:15 AM
jamieB jamieB is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2002
Posts: 596 jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level)jamieB User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 3 h 19 m 33 sec
Reputation Power: 18
xml?
xml Code:
Original - xml Code
  1.  
  2. <elementSet type="numbered">
  3.   <element name="Some Title">
  4.     <elementSet type="alpha">
  5.      <element name="Something here" />
  6.      <element name="Something Else" />
  7.     </elementSet>
  8.   </element>
  9.   <element name="Another Title">
  10.   <elementSet type="alpha">
  11.     <element name="I'm here Again">
  12.        <elementSet type="alpha">
  13.          <element name="And again." />
  14.          <elementSet type="alpha">
  15.            <element name="One more indent" />
  16.          </elementSet>
  17.        </element>
  18.       </elementSet>
  19.   </element>
  20.   <element name="and another" />
  21. </elementSet>

so parse this with C# (which I can't help you with) and every time you encounter an elementSet node indent the display and start counting numbers/letters and list the elements/elementSets within it recursively.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > Creating an ORdered List (NOT useing HTML)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT