We found out that in JMIX, while creating a new Report Band, there was no option to NOT set a Dataset type to it, whereas back in CUBA we are not required to set the type specifically while creating a new band.
This caused issues like when we are trying to print our Report’s header, all the header keywords are replaced with an empty string because the default type is Groovy and returning an empty map as default like below:
The workaround we did currently was to manually remove this default value by patching the XML column of REPORT_REPORT table from the backend, and the report works fine as it is.
So for this, could we have the same behavior back in CUBA while creating new Report Bands, to not default the Dataset type to Groovy and allow users to have it remain empty while setting it up?
I have a root Groovy header like this return [['title' : (params['reportTitle'] + '_' + params['script'].scriptKey)]]
These are input parameters, you can put any wording as strings, too.
After that, I have a Groovy header return [[:]]
I don’t need column names because I use JRXML templates.
After that, I have a normal data band.
When I was creating the report, the bands I created were default Groovy, with ‘return [[:]]’ as default. This default should not interfere at all with the rest of the report.
Maybe I do not understand the exact problem here. Why do you need empty newBand1? Maybe it can help if you send us example report code.
Mladen is right that return [[:]] is often used as a simple “empty” band, for example for static headers, and in many reports it should not affect the result.
But your case may be different. If the template region contains placeholders and the corresponding band has a Groovy dataset returning an empty map, these placeholders can be processed against this empty row. Since the map does not contain the required keys, the values may be replaced with empty strings.
So I understand why this can be a problem for reports migrated from CUBA, where such bands could be left without a dataset and used only as structural/container bands.
As a workaround, instead of patching the REPORT_REPORT table manually, you can try one of these options:
return the required header values from this Groovy dataset;
or move the placeholders to the band that actually provides these values.
For example, if the values come from report parameters:
We will discuss whether we can support the “band without dataset” behavior in the Jmix report editor, especially for reports migrated from CUBA.
Could you please attach a small exported report XML and template where return [[:]] breaks the header? It would help us reproduce the case and create a proper issue.