Completed
Last Updated: 05 Apr 2021 10:13 by ADMIN
Release R2 2021
David
Created on: 25 Mar 2021 12:54
Category: WordsProcessing
Type: Bug Report
1
WordsProcessing: RtfFormatProvider: Wrong indexing when export the list override index ("\ls")

According to the RTF specification: The valid values for the "\ls" index are from 1 to 2000.

They are currently exported from zero or "\ls0".

7 comments
ADMIN
Dimitar
Posted on: 05 Apr 2021 10:13

Hello David,

I have logged this for investigation on your behalf. You can track its progress, subscribe to status changes, and add your comment to it here. I have updated your Telerik points as well. 

Unfortunately due to the nature of the issue, I cannot suggest a workaround. 

Let me know if I can assist you further.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

David
Posted on: 02 Apr 2021 05:54

Good Morning Dimitar.

The way I can reproduce is. First the user enters some texts and makes it an enumeration:


Second, we write it with this code into a file, called asdf.rtf:

Finally we get this rtf:

Thanks a lot for Your Help on this one!

BR

David

 

ADMIN
Dimitar
Posted on: 31 Mar 2021 11:09

Hi David,

I have tested this with a similar code and the list starts with \ls2 on my side. Can you send me the code that you are using to create the list? This way I will be able to reproduce the exact case. Here is the code I am testing with:  

private void radButton1_Click(object sender, EventArgs e)
{
    RadDocument document = new RadDocument();
    Section section = new Section();
    document.Sections.Add(section);

    ListStyle list = new ListStyle();

    for (int levelIndex = 0; levelIndex < 9; levelIndex++)
    {
        ListLevelStyle listLevel = new ListLevelStyle();
        list.Levels.Add(listLevel);

        bool isEven = (levelIndex % 2) == 0;
        list.Levels[levelIndex].StartingIndex = 1;
        list.Levels[levelIndex].NumberingFormat = ListNumberingFormat.Decimal;
        list.Levels[levelIndex].LevelText = isEven ? "{" + levelIndex + "}." : "o";
        list.Levels[levelIndex].Indent = 48 + (levelIndex * 24);
    }

    DocumentList documentList = new DocumentList(list, document);

    for (int levelIndex = 0; levelIndex < list.Levels.Count; levelIndex++)
    {
        Paragraph paragraph = new Paragraph();
        document.Sections.First.Blocks.Add(paragraph);
        paragraph.Inlines.Add(new Span(string.Format("ListLevel: {0}", levelIndex + 1)));
        paragraph.ListId = documentList.ID;
        paragraph.ListLevel = levelIndex;
    }

    radRichTextEditor1.Document = document;

    RtfFormatProvider provider = new RtfFormatProvider();
    var rtf = provider.Export(document);
    File.WriteAllText(@"..\..\result.rtf", rtf);
}

I am looking forward to your reply.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

David
Posted on: 30 Mar 2021 04:26

Great - Thanks a lot Dimitar! 

We have noticed one more similar thing when exproting from the Telerik.WinControls.UI.RadRichTextEditor. With this control the behavior  is similar when we export lists and enumerations using the Telerik.WinForms.Documents.FormatProviders.Rtf.RtfFormatProvider:

  • The \ls is indexed with 3 instead of with 1. Maybe you can have a look at that too, because our legacy textsoftware (TxtTextControl) doesn't handle it properly.

I am not sure if this is within spec, but it causes problems.

Would be very kind again if you might help us out here.

BR

David Wieser

 

ADMIN
Dimitar
Posted on: 29 Mar 2021 13:58

Hello David,

Yes, the fix will be available for WinForms as well. Please check your account tomorrow for the latest internal build for WinForms. 

Let me know if I can assist you further.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

David
Posted on: 29 Mar 2021 08:38

Thanks for the quick resolution Peshito and Telerik Team.

Will the solution be available for WinForms too? Because we work on Wiforms and you write WPF.

THX

David

ADMIN
Peshito
Posted on: 29 Mar 2021 07:45

Hello,

This item will be available in R2 2021 Release. 

 

It is also available with the following internal builds:
  • Telerik UI for WPF - LIB 2021.1.329 (29/3/2021)
  • Telerik UI for Xamarin - LIB 2021.1.329 (29/3/2021)

Regards,
Peshito
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.