Creating report with rich text field does not work consistently

Hi,

I have an object that contains a rich text field (unlimited string, edited with the rich text editor of the CUBA platform) which I want to include in a report (DOCX currently). I have setup a report and set the value formatting for the rich text field to ${html}.

At first, it didn’t work at all. However, based on this remark “In the output value, you may omit top-level tags up to inclusive.” from https://doc.cuba-platform.com/reporting-6.4/formatters.html, I added tags to the field content and now some html content is shown correctly.

It works correctly when I only have a very small text with basic formatting, e.g.:


<html><body>Text  <b>BOLD</b> Text</body></html>

But when the content is more complex (kinda) it doesn’t seem to work:


<html><body>Nog meer <b>opmaak</b> of toch niet nu dat de <u>html</u> tags verdwenen zijn? Nog meer&nbsp;<b>opmaak</b>&nbsp;of toch niet nu dat de&nbsp;<u>html</u>&nbsp;tags verdwenen zijn? Nog meer&nbsp;<b>opmaak</b>&nbsp;of toch niet nu dat de&nbsp;<u>html</u>&nbsp;tags verdwenen zijn? Nog meer&nbsp;<b>opmaak</b>&nbsp;of toch niet nu dat de&nbsp;<u>html</u>&nbsp;tags verdwenen zijn?</body></html>

I would expect the result from the rich text editor to be used for reporting without problems. What am I doing wrong?

1 Like

Hi Berend,

I tried to reproduce the problem with your content. Result document opens correctly in Word. But in LibreOffice HTML content isn’t displayed. I will be able to help you if you send me a small sample project along with reproduction scenario that demonstrates the issue.

Hi Andrey,

Attached is the project, the report definition and some sample content (to be imported through the entity manager). For this content I get mixed results. Some show correctly, some are empty, some even generate errors when opening them in Word.

And the content is consistently not shown when opened with OpenOffice. This troubles me especially as I am aiming to generate it as pdf in the end using OpenOffice.

It seems very buggy/inconsistent. Or I’m doing something wrong - that’s also an option :wink:

Content.zip (1.8K)

Report for entity -Rich Text Object-.zip (7.9K)

RichTextReporting.zip (85.9K)

Hi Berend,

We found some problems with DOCX reports. We have created a YouTrack issue, see the link on the right.
When I tried to print a report in DOC, it’s shown correctly. As workaround, you can try DOC reports.

Hi Andrey,

That’s correct - using .doc works better. I still have some issues to overcome getting all my data in the report but these are my own concerns.

Thankx!

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-8625