Extreme bloat with HTML provider

4 posts, 1 answers
  1. John E.
    John E. avatar
    2 posts
    Member since:
    Jan 2014

    Posted 15 Jun 2015 Link to this post

    Greetings-

    We are using the RichTextBox to edit/display HTML content that is stored in SharePoint.  Each time the content is bound and rendered in the RichTextBox, the size grows exponentially.  We would not have noticed the issue if it were not for the fact that the text has gotten so large, SharePoint is rejecting the post of data, which has broken our application in production.  I would have attached a zipped version of the HTML that was generated, but that isn't supported.  It looks like several redundant styles are being created - you have to get past line 32000 to get to the body of the HTML.  When you get toward the end of the styles, you end up with style names like ".TableNormalParagraphParagraphParagraphCharacterParagraphCharacterCharacterCharacterCharacterCharacterCharacter". 

     

    Is this a known issue or is there a new setting I have missed?  We're using version "UI for Silverlight Q3 2014 SP1".

     

    Thanks in advance for your time and advice!

     

  2. Mihail
    Admin
    Mihail avatar
    192 posts

    Posted 18 Jun 2015 Link to this post

    Hello John,

    I couldn't manage to reproduce the described behavior. My test scenario is:
    1. Adding content (paragraph, tables lists, applying styles)
    2. Save to Html.
    3. Open the saved file.
    4. Add content.
    5. Repeat same steps multiple times.

    Could you provide more information on what steps we need to follow in order to reproduce the described issue.

    Regards, Mihail
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. John E.
    John E. avatar
    2 posts
    Member since:
    Jan 2014

    Posted 26 Jun 2015 in reply to Mihail Link to this post

    Mihail-

    Thank you for the reply.  Your steps seem accurate.  The only difference is that we're reading/writing the HTML to/from a SharePoint list.  Each time that we read/write from the list, the control creates another set of styles that is unique from the previous version.  At one point, we had a single field that was 10mb in size with 9.9mb being style declaration.  The fix for us has been to modify the HtmlDataProvider settings.  I added the following and fields that were previously 10mb, are now 2k:

     

    <documentsHtml:HtmlDataProvider x:Name="BranchChiefDataProvider"
                                                            Html="{Binding Path=Item.BranchChiefInstructions,
                                                                           Mode=TwoWay}"
                                                            RichTextBox="{Binding ElementName=RrtbBranchChiefInstructions}"
                                                            SetupDocument="HtmlDataProviderSetupDocument">
                                <telerik:HtmlDataProvider.FormatProvider>
                                    <telerik:HtmlFormatProvider>
                                        <telerik:HtmlFormatProvider.ImportSettings>
                                            <telerik:HtmlImportSettings UseDefaultStylesheetForFontProperties="True" />
                                        </telerik:HtmlFormatProvider.ImportSettings>
                                        <telerik:HtmlFormatProvider.ExportSettings>
                                            <telerik:HtmlExportSettings StyleRepositoryExportMode="DontExportStyles" StylesExportMode="Inline" />
                                        </telerik:HtmlFormatProvider.ExportSettings>
                                    </telerik:HtmlFormatProvider>
                                </telerik:HtmlDataProvider.FormatProvider>
                            </documentsHtml:HtmlDataProvider>

     Since there is a workaround, we've resolved our production issue, but it would be nice to know what the root cause was.  The only other piece of information is that we recently upgraded from the Silverlight 4 Telerik controls to the Silverlight 5 version.

     

    Thanks in advance for your time!

  5. Answer
    Mihail
    Admin
    Mihail avatar
    192 posts

    Posted 01 Jul 2015 Link to this post

    Hello John,

    Thank you for the reply.

    I have noticed that you are using SetupDocument="HtmlDataProviderSetupDocument". This method will be called every time the RichTextBox is shown or the html source property is changed outside the HtmlDataProvider. If you add any content or styling on that method it could lead to bigger and bigger document each time the same document is shown in RadRichTextBox using this HtmlDataProvider.
    Restricting the styles to be exported only as inline styling could lead to less content as each element has limited number of style properties.

    If you want to isolate from where the problem is coming my recommendation is to start from the basic banding with RichTextBox and HtmlDataProvider. We have such demo project as SDK example, which you could use as a starting point. Customizing the project on one step at a time by adding the additional functionality you have should show you what is causing the problem.

    I hope this information is helpful for you. In case you find any unexpected behavior or you have further questions feel free to contact us again.

    Regards,
    Mihail
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top