Dynamically set format in action-report

Is there a way to dynamically set the format attribute of action-report?
I know that the attribute itself does not support the 'eval: ’ syntax, it only accepts the predefined values, but is there another way to do it in xml or do I have to use action-method instead and write java code?

Background:
I have a « wizard » form that allows the user to set certain parameters an select the format of the report. Then the user clicks the print button and the report should be output in the forma he selected.

action method is more better and powerful to use, and eval will be ugly soon and not maintainable. Writing a action method is not that hard.

Action methods are not that hard but they do need considerably more boilerplate code (controller->service interface->service implementation). They are indeed a lot more powerful.

The problem with action methods is Java code. At least in my setup hot reload works erratically. Most of the times it doesn’t work and needs a restart of the server. Restarting the server takes a little bit less than 10 minutes (including recompilation) which makes the development cycle painfully slow.

Changes in xml on the other hand are really fast (almost instant). So when xml vies and action can do the job I try to avoid Java code.

yes this is where axelor is bad, not able to speed up it yet, which IDE you use, we were able to run hot reload on intellij and vscode, and vscode is more better approach.

wish you good luck, there are always tradeoff :slight_smile:

I am using Eclipse (which IMHO is a mess). I would much prefer to use VS Code, so much cleaner, but had some issues at first trying to get axelor to build in VSCode. Maybe I’ll try that again.

eclipse gave us hard time, long ago left the eclipse