Q1 2012:Export the document in HTML that is compatible with HtmlTextBox from Reporting

6 posts, 0 answers
  1. Uwe
    Uwe avatar
    2 posts
    Member since:
    Jan 2012

    Posted 07 Mar 2012 Link to this post

    "Export the document in HTML that is compatible with HtmlTextBox from Reporting" is listed as "NEW" in ReleaseNotes Q1 2012.

    How can i use this new feature?   Witch settings are right? 

    This settings doesn't work!
     
    telerikDocs.FormatProviders.Html.HtmlFormatProvider htmlFormatProvider = new telerikDocs.FormatProviders.Html.HtmlFormatProvider();
    telerikDocs.FormatProviders.Html.HtmlExportSettings htmlExportSettings = new telerikDocs.FormatProviders.Html.HtmlExportSettings();
    htmlExportSettings.StylesExportMode = telerikDocs.FormatProviders.Html.StylesExportMode.Inline;
    htmlExportSettings.ExportFontStylesAsTags = true; 
    htmlExportSettings.DocumentExportLevel = telerikDocs.FormatProviders.Html.DocumentExportLevel.Fragment;
    htmlFormatProvider.ExportSettings = htmlExportSettings;
    string html = htmlFormatProvider.Export(richTextBox.Document);
    
     
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 09 Mar 2012 Link to this post

    Hello Uwe,

    We have introduced styles exporting in HTML, so what you see is probably the style repository being written as CSS styles. In order to be compatible with the HTML input that HtmlTextBox recognizes, the document must not include these classes. In order to do that, you have to set one other property as well:

    htmlExportSettings.StyleRepositoryExportMode = telerikDocs.FormatProviders.Html.StyleRepositoryExportMode.DontExportStyles;

    I hope this helps.

    Greetings,
    Iva Toteva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Uwe
    Uwe avatar
    2 posts
    Member since:
    Jan 2012

    Posted 14 Mar 2012 Link to this post

    Hi Iva,

    thank you for your fast answer.

    Yes it works, now i put the content from the RTF-Control directly in the value of the HtmlTextBox im my report.
    But the content in the HtmlTextBox doen't look like the content in the RTF-Control. Is there no way to transfer the style.

    Here is a sample of HTML-Code from the RTF-Control. If i put it in a HTML-File and open it with a browser it looks like the content in the RTF-Control.

    <p style="text-indent: 0pt;padding: 0px 0px 0px 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;text-indent: 0px;line-height: 1.14583333333333;text-align: left;"><span style="font-family: 'Arial';font-style: Normal;font-weight: bold;font-size: 14.6666666666667px;color: #000000;">Top-Performance mit garantierten CPU- und RAM-Ressourcen</span></p><p style="text-indent: 0pt;padding: 0px 0px 0px 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;text-indent: 0px;line-height: 1.14583333333333;text-align: left;"><span style="font-family: 'Trebuchet MS';font-style: Normal;font-weight: normal;font-size: 14.6666666666667px;color: #000000;">&nbsp;</span></p><p style="text-indent: 0pt;padding: 0px 0px 0px 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;text-indent: 0px;line-height: 1.14583333333333;text-align: left;"><span style="font-family: 'Arial';font-style: Normal;font-weight: normal;font-size: 14.6666666666667px;color: #000000;">Virtual Server 4.0: Die Power-Revolution mit bis zu 8 GB garantiertem RAM und bis zu </span><span style="font-family: 'Arial';font-style: Normal;font-weight: normal;font-size: 14.6666666666667px;color: #000000;">6 GHz </span><span style="font-family: 'Arial';font-style: Normal;font-weight: normal;font-size: 14.6666666666667px;color: #000000;">garantierter CPU-Leistung! Ideal für jeden professionellen </span><span style="font-family: 'Arial';font-style: Normal;font-weight: normal;font-size: 14.6666666666667px;color: #000000;">Einsatz, </span><span style="font-family: 'Arial';font-style: Normal;font-weight: normal;font-size: 14.6666666666667px;color: #000000;">bei dem maximale Flexibilität und Performance gefragt ist! Wahlweise mit vollem System-Zugriff oder einfacher Bedienoberfläche mit einem Betriebssystem, das von Host Europe gemanagt wird.</span></p><p style="text-indent: 0pt;padding: 0px 0px 0px 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;text-indent: 0px;line-height: 1.14583333333333;text-align: left;"><span style="font-family: 'Arial';font-style: Normal;font-weight: normal;font-size: 14.6666666666667px;color: #000000;">Darüber hinaus profitieren Sie von einer Traffic-Flatrate mit klar definierten </span><span style="font-family: 'Arial';font-style: Normal;font-weight: normal;font-size: 14.6666666666667px;color: #000000;">Leistungsgarantien.</span><span style="font-family: 'Trebuchet MS';font-style: Normal;font-weight: normal;font-size: 11px;color: #000000;" /></p>

    Greetings Uwe
  5. Mihail
    Admin
    Mihail avatar
    192 posts

    Posted 20 Mar 2012 Link to this post

    Hi Uwe,

    Unfortunately there are some limitations in Telerik Reporting related to HTML tags and CSS attributes that are supported. You can read more about them here.

    However, provided that you have set all properties of the HtmlExportSettings listed below, the exported document should look quite close to the original one. Please find attached a demo which we used for testing and which has led us to believe that everything works as expected. If you notice some issues, do not hesitate to contact us again.

    Regards,
    Mihail
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Gene
    Gene avatar
    3 posts
    Member since:
    Nov 2011

    Posted 23 Apr 2012 Link to this post

    I've also run into this issue after upgrading.  Prior to updating to Q1 2012, all standard text-formatting tags(bold, italic, etc.) worked in the HtmlTextbox when exported from RadRichTextbox.  After updating, even when following your example, such tags are not exported in a manner that can be displayed by the HtmlTextbox(however, hard-coded HTML does display properly in the HtmlTextbox, telling me the problem is in fact with the FormatProvider).

    Our client was pleased with the level of formatting possible with the solution before, but this will not be acceptable.  I can't simply roll back the HtmlFormatProvider to the previous version as RadRichTextbox depends on the newer library.  Will this be addressed and is there a workaround?
  7. Mihail
    Admin
    Mihail avatar
    192 posts

    Posted 25 Apr 2012 Link to this post

    Hi Gene,

    Unfortunately we couldn't reproduce the described issue. Could you create a simple document in the editor, which illustrates the issue when exported to HTML and used in Telerik Reporting. After creating such a document, export it to XAML and attach it to a support ticket so we can investigate further this issue.

    Looking forward to your reply.

    Greetings,
    Mihail
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner