All HTML and CSS Formatting Lost in RadDocument

1 Answer 58 Views
Report Viewer - Angular Rest Service
Troy
Top achievements
Rank 1
Troy asked on 27 Jan 2023, 07:01 PM

We are having an issue where HTML saved to a database from the Editor component in Kendo UI for Angular does not render correctly in a Telerik report.

These are the steps we are following:

  • An HTML string is retrieved from a database
  • The Import method is called on an HtmlFormatProvider object using the HTML string, returning a RadDocument object
  • The InsertDocument method is called on a RadFlowDocumentEditor object using the RadDocument object from the previous step
  • The Export method is called on a PdfFormatProvider using the RadDocument object and the bytes are served via a REST API as a memory stream

The HTML saved in the database renders correctly in the Kendo UI Editor component. However all of the CSS formatting and spacing (including fonts, etc.) is lost when the RadDocument memory string is loaded into the Angular Report Viewer.

Is this the expected behavior? Is it possible to render pure HTML in a RadDocument and present this to a user unaltered in the Report Viewer?

1 Answer, 1 is accepted

Sort by
1
Accepted
Dimitar
Telerik team
answered on 01 Feb 2023, 09:36 AM

Hello Troy,

The HtmlTextBox Report Item does not support all HTML and CSS tags, and also, respects only inline styles so if you have the styles coming from a stylesheet, it is expected for them to not be rendered correctly on the preview.

For more details on the supported features and the limitations, please have a look at the following articles:

As a workaround, you may try to implement the approach from the Display, unsupported by the HtmlTextBox, HTML and CSS content in your reports. - Telerik Reporting KB article which is to basically render the HTML to an image and use the PictureBox item to display the content.

Please let me know if you have any further questions.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
Report Viewer - Angular Rest Service
Asked by
Troy
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or