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);
5 Answers, 1 is accepted
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
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;"> </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
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.
Mihail
the Telerik team
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?
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.
Mihail
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>