Content of a richTextEditor not exported properly in spreadsheet reports

Hi,
I have created an Excel based report using the add-on (Jmix 1.5) but I’ve noticed that fields that are related with a richTextEditor field on the screen are not displayed properly. I suppose that this is due to the formatting options that cannot be recognized by Excel. In this case, is there any available workaround?

Thanks

Hello,

how are they displayed, what’s wrong? Are the e.g. line breaks ignored? Maybe give us a picture.

Kind regards,
Mladen

Hi,
I tried also to generate the report in MS Word but I had the same problem. You can check below the content of the field in the Jmix app to compare it with the respective content in the MS Word document:

Jmix Field Content:

image

MS Word document

image

Thank you

Hello, I see, and it can be solved.

Problem is this - rich text field is having a HTML content as value, and is rendering it properly. (well yes, that’s the purpose of such component)
When you take that value, which is HTML content, it is passed as raw HTML to word as is, with both text and HTML elements, and Word is not displaying this as HTML, because quote “Word doesn’t natively support rendering raw HTML as styled content within its cells”.

Maybe there is a way to format somehow that cell in your word template, but I think better solution is to make a jrxml template, as it will support many outputs. Then you can specify this field something like this:

<textField isStretchWithOverflow="true">
    <reportElement x="0" y="0" width="200" height="50" />
    <textElement markup="html">
        <font size="12"/>
    </textElement>
    <textFieldExpression><![CDATA[$F{htmlContent}]]></textFieldExpression>
</textField>

Jrxml template is a bit harder to make than a word template, but you will be rewarded.

Kind regards,
Mladen

1 Like