Preprocess entity data for report

Hello,
I need to preprocess same fields of an entity for a report. I found the com.haulmont.yarg.reporting.extraction.PreprocessorFactory and I’m trying to implement and register a preprocessor, but can’t find an elegant way.

What I need to do is replace some keywords in a field of type String with data from other entity fields. (some kind of template replacement with a bit of calculation and processing)

Help would be greatly appreciated.

PS: Also - maybe a second question - how can I set the locale for a generated report? I want to let the user decide if the report should be generated in english or german.

I decided to persist the preprocessed data into a new field and use this field in the report.

But the question for setting the locale still remains, any input maybe?

Hi,

You could just use multiple templates containing the different locales. Then automatically the popular comes up when running the report for the user to select.

Cheers
Mario

@mario Thanks for your suggestion. Yes, for the template content that’s not the problem, but e.g. for automatically formatted dates and numbers I can’t simply use another template, as I can’t set a locale in a report template.

Example: “5. Januar 2020” vs “5th January 2020”

Similar problems with numbers, e.g.: “3,000.00” (US) vs “3.000,00” (DE)