Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Jan 08, 2020 8:05 am

There i hava a ducument which hava a tableOfContent like blow:
第一章 aa
第二章 bb
(一)cc
1 dd
2 ee

In the document i have created a multi list style.but when i use " doc.UpdateTableOfContents()" to update my tableOfContent,result is like this:
1. aa
2. bb
1.cc
1st.dd
2nd.ee

I want the tableOfContent's list style just like the content i have created "第一章 aa ....",what can i do?

standheo
 
Posts: 24
Joined: Mon Oct 08, 2018 11:13 am

Wed Jan 08, 2020 8:33 am

I find that after i hava applyed a listStyle to a paragraph,and check the ListText property's value ,it shows '1.',but i want is '第一章'
Code: Select all
var p = section.AddParagraph();
            p.AppendText(text);
            p.ApplyStyle(BuiltinStyle.Heading1);
            p.ListFormat.ListLevelNumber = 0;
            p.ListFormat.ApplyStyle(DefalutListStyle);
            var listStr = p.ListText;


my listStyle[0]'s setting:
Code: Select all
 listLevel0.NumberPrefix = "第";
            listLevel0.NumberSufix = "章";
            listLevel0.PatternType = ListPatternType.ChineseCounting;

standheo
 
Posts: 24
Joined: Mon Oct 08, 2018 11:13 am

Wed Jan 08, 2020 10:07 am

I hava found the issue, this line "listLevel0.PatternType = ListPatternType.ChineseCounting;" ,after i changed it to "listLevel0.PatternType = ListPatternType.ChineseCountingThousand;",it works!
what's difference between ListPatternType.ChineseCounting and ListPatternType.ChineseCountingThousand?

standheo
 
Posts: 24
Joined: Mon Oct 08, 2018 11:13 am

Wed Jan 08, 2020 10:17 am

Hi,

Thanks for your inquiry.
The ChineseCounting specifies that the sequence shall consist of one or more occurrences of a single ascending number from the Chinese counting system.
The ChineseCountingThousand specifies that the sequence shall consist of one or more occurrences of a single sequential number from the Chinese counting thousand system.

Besides, after an initial testing I didn't reproduce your issue. If you still have issues, please provide input file(if any) and full code for reproducing your issue.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Jan 09, 2020 7:52 am

Here is my test code:
Code: Select all
            Document document = new Document();
            var section = document.AddSection();

            ListStyle listStyle = new ListStyle(document, ListType.Numbered);
            listStyle.Name = "levelstyle";
            listStyle.Levels[0].PatternType = ListPatternType.Arabic;
            listStyle.Levels[0].NumberPrefix = "第";
            listStyle.Levels[0].NumberSufix = "章";
            listStyle.Levels[0].PatternType = ListPatternType.ChineseCountingThousand;
            listStyle.Levels[0].FollowCharacter = FollowCharacterType.Nothing;
            listStyle.Levels[0].IsLegalStyleNumbering = false;
            listStyle.Levels[0].NoRestartByHigher = false;
            listStyle.Levels[0].UsePrevLevelPattern = false;

            listStyle.Levels[1].UsePrevLevelPattern = false;
            listStyle.Levels[1].NumberPrefix = "\x0000.";
            listStyle.Levels[1].PatternType = ListPatternType.Arabic;

            listStyle.Levels[2].NumberPrefix = "\x0000.\x0001.";
            listStyle.Levels[2].PatternType = ListPatternType.Arabic;
            listStyle.Levels[2].IsLegalStyleNumbering = true;

            var listLevel4 = listStyle.Levels[3];
            listLevel4.UsePrevLevelPattern = true;
            listLevel4.PatternType = ListPatternType.Arabic;
            listLevel4.NumberPrefix = "图\x0000-";
            listLevel4.NumberSufix = "";
            listLevel4.IsLegalStyleNumbering = false;
            listLevel4.ParagraphFormat.LeftIndent = 0;
            listLevel4.ParagraphFormat.LineSpacing = 12 * 1.5f;
            listLevel4.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Center;
            listLevel4.ParagraphFormat.KeepFollow = false;
            listLevel4.CharacterFormat.Bold = false;
            listLevel4.CharacterFormat.FontName = "黑体";
            listLevel4.CharacterFormat.FontSize = 9;

            document.ListStyles.Add(listStyle);

            var paragraph = section.AddParagraph();
            paragraph.AppendText("figureaaa");
            paragraph.ApplyStyle(BuiltinStyle.Caption);
            paragraph.ListFormat.ListLevelNumber = 3;
            paragraph.ListFormat.ApplyStyle("levelstyle");
            Console.WriteLine(paragraph.ListText);

console print result is "图一-1",this result is not correct,i have seted "IsLegalStyleNumbering=true".after i changed the code "listStyle.Levels[0].PatternType = ListPatternType.ChineseCountingThousand" to"listStyle.Levels[0].PatternType = ListPatternType.ChineseCounting",it print "图1-1" ,i think it's correct

standheo
 
Posts: 24
Joined: Mon Oct 08, 2018 11:13 am

Thu Jan 09, 2020 9:46 am

Hi,

Thanks for your information.
After checking your code, I found you used Level number 3 for the paragraph, but the property "IsLegalStyleNumbering" set was false for the level, please set it as true.
Code: Select all
            listLevel4.IsLegalStyleNumbering = true;

The result in Word will be "图1-1". As for why paragraph.ListText prints "图1-1" in console, actually, the result has issues, we have fixed it and will include the fix in next version.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Jan 10, 2020 2:26 am

How long about to have the next release version? i expected this issus to be fixed

standheo
 
Posts: 24
Joined: Mon Oct 08, 2018 11:13 am

Fri Jan 10, 2020 7:55 am

Hi,

There might be some
Sorry that there is no estimated time about the new hotfix which includes the fix. Anyway, we will let you know once it is released.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Feb 12, 2020 10:24 am

Hi,

Thanks for waiting.
Now the issue I mentioned has been solved in Spire.Doc Pack(hot fix) Version:8.2.4. Welcome to download it from the following link.
Our website: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget: https://www.nuget.org/packages/Spire.Doc/8.2.4

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Feb 17, 2020 6:26 am

Hi,

Hope you are doing well.
Did you try the hotfix? Has your issue been resolved?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc