How to insert a string field with newline in the content in docx report

I use report addon to generate documents from DOCX template.
I have some fields that are “comments” including newline.
All are good in the application, textArea save newline and display newline.
But in a docx report the same field will display its content without newline…
How can I correct this ?

In Jmix
In Word

I’m looking for a global solution, I have more than 1000 fields…

I use Jmix 1.6

Hi,

Newline within simple String value is not supported yet for docx reports. We have an issue for that.

There are possible WA:

Use rich text

Use RichTextArea to input data to field and use HTML formatter for that value (Report Parameters and Field Formatters :: Jmix Documentation).
But this may not work for you if you have a lot of fields.

Use custom ContentInliner

You can try to implement you own custom ContentInliner to support newline for current values.
You will also need to register new ContentInliner - override existing bean JmixInlinersProvider (declared in ReportsConfiguration) and add custom ContentInliner:

@Primary
@Bean
public JmixInlinersProvider inlinersProvider(FileStorageContentInliner fileStorageContentInliner, CustomContentInliner customContentInliner) {
    return new JmixInlinersProvider(fileStorageContentInliner, customContentInliner);
}

And in report you will need to apply formatter related to new ContentInliner.

Regards,
Ivan

I used the ContentInliner, it’s OK…
but I had to install it for each variable in the report…
10 reports… more than 100 fields…

I will have to find a way to execute the inliner for each text variable…