We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Numbered List

Thread ID:

Created:

Updated:

Platform:

Replies:

75694 Aug 6,2008 11:31 AM May 10,2010 08:07 AM Windows Forms 6
loading
Tags: DocIO
Hans Preuer
Asked On August 6, 2008 11:31 AM

Hello,

I'm evaluating DocIO and I have the following problem:

I will have a numbered list which looks like:

1 Header1
1.1 Header2
1.1.1 Header3
Standardtext ......

All numbers should beginn on left without indents and only 1 space between the numbers and the Headertext. And this numbering should be right for use in a Table of Content to a level of 3.

When I use paragraph.ListFormat.ApplyDefNumberedStyle() I get something like:
1 Header1
a. Header2
Standardtext ......

I've tried to make a new ParagraphStyle, but I can't remove the spaces between
1 Header1
and so on. How can I define a numbered liststyle which looks like my wanted style?

Thanks for any help.
Hans


Bhuvaneswari P [Syncfusion]
Replied On August 7, 2008 08:06 AM

Hi Hans,

Thanks for evaluating Syncfusion products.

Yes, it is possible to create a number list like you given by using the FollowCharacter and TabSpaceAfter property of the Listlevel object. Please refer the below code snippet to do so:
[VB]

Dim styleN As ListStyle = doc.AddListStyle(ListType.Numbered, "ListStyleN")
Dim listLevelL0 As WListLevel = styleN.Levels(0)
//Specify the type either Tab or Space
listLevelL0.FollowCharacter = FollowCharacterType.Space
listLevelL0.TabSpaceAfter = 1

Here is the sample which illustrates the above said feature:

http://websamples.syncfusion.com/samples/DocIO.Windows/P48637_1/main.htm

Please try this sample and let us know if this helps you.

Best Regards,
Bhuvana


Hans Preuer
Replied On August 7, 2008 11:04 AM

Hi Bhuvana,

Thanks, now this works.

Hans


Bhuvaneswari P [Syncfusion]
Replied On August 11, 2008 08:37 AM

Hi Hans,

Thanks for the update.

Regards,
Bhuvana


Boris Mouzo Izquierdo
Replied On May 5, 2010 10:43 AM

Hi,

I have a similar problem as the one who started this post but left unanswered. I'm generating a Word document with a numbered list. Let's say I need the following list:

1. Header1
1.1. Header1_1
1.1.1. Header1_1_1
1.1.2. Header1_1_2
1.2. Header1_2

As for now I've managed to get this:
1. Header1
1. Header1_1
1. Header1_1_1
2. Header1_1_2
2. Header1_2

What do I need to add or change to show on the indented headers the numbering of the parent header?

Thanks in advance

Boris Mouzo Izquierdo
Replied On May 6, 2010 03:12 AM

Problem solved. After looking around a lot and googling through different pages I found the answer. I'll leave the link in case someone else has the same problem (search for deep level numbering instead of numbered list):
http://www.syncfusion.com/support/kb/289/How-to-create-the-deep-level-numbering%28-11-121-122-etc%29-using-DocIO


C#
ListStyle styleN = document.AddListStyle(ListType.Numbered, "ListStyleN");
WListLevel listLevelL0 = styleN.Levels[0];
listLevelL0.CharacterFormat.FontSize = 16;
listLevelL0.CharacterFormat.Bold = true;
listLevelL0.CharacterFormat.Italic = true;
listLevelL0.ParagraphFormat.LeftIndent = 0;
listLevelL0.ParagraphFormat.FirstLineIndent = 20;
WListLevel listLevelL1 = styleN.Levels[1];
listLevelL1.IsLegalStyleNumbering = true;
//Numberprefix defines prefix before numbering.
//\x0000 - defines that numbering of the previous level will be inherited
listLevelL1.NumberPrefix = "\x0000.";
listLevelL1.ParagraphFormat.LeftIndent = 70;
listLevelL1.ParagraphFormat.FirstLineIndent = -10;
WListLevel listLevelL2 = styleN.Levels[2];
listLevelL2.IsLegalStyleNumbering = true;
//\x0000.\x0001. - inherirs numbering of level 0 and 1
listLevelL2.NumberPrefix = "\x0000.\x0001.";
listLevelL2.ParagraphFormat.LeftIndent = 130;
listLevelL2.ParagraphFormat.FirstLineIndent = -40;

VB
Dim styleN As ListStyle = document.AddListStyle(ListType.Numbered, "ListStyleN")
Dim listLevelL0 As WListLevel = styleN.Levels(0)
listLevelL0.CharacterFormat.FontSize = 16
listLevelL0.CharacterFormat.Bold = True
listLevelL0.CharacterFormat.Italic = True
listLevelL0.ParagraphFormat.LeftIndent = 0
listLevelL0.ParagraphFormat.FirstLineIndent = 20
Dim listLevelL1 As WListLevel = styleN.Levels(1)
listLevelL1.IsLegalStyleNumbering = True
''Numberprefix defines prefix before numbering.
''\x0000 - defines that numbering of the previous level will be inherited
listLevelL1.NumberPrefix = ChrW(&H0000).ToString() & "."
listLevelL1.ParagraphFormat.LeftIndent = 70
listLevelL1.ParagraphFormat.FirstLineIndent = -10
Dim listLevelL2 As WListLevel = styleN.Levels(2)
listLevelL2.IsLegalStyleNumbering = True
''\x0000.\x0001. - inherirs numbering of level 0 and 1
listLevelL2.NumberPrefix = ChrW(&H0000).ToString() & "." & ChrW(&H0001).ToString() & "."
listLevelL2.ParagraphFormat.LeftIndent = 130
listLevelL2.ParagraphFormat.FirstLineIndent = -40

Poornima R [Syncfusion]
Replied On May 10, 2010 08:07 AM

Hi Boris,

Thank you for your update.

We are glad that you have found the solution by yourself.

Please let us know if you have any other further queries.

Regards,
Poornima

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;