intive-FDV / DynamicJasper

Dynamic Reports using Jasper Reports
http://intive-fdv.github.io/DynamicJasper/
GNU Lesser General Public License v3.0
241 stars 128 forks source link

Subreport styled headers / not styled correctly (when exported to docx) #118

Closed zpolic closed 1 year ago

zpolic commented 2 years ago

The problem is in AbstractLayoutManager method: createUniqueStyleName. When you add subreport and try to apply styles to its header cells, the style counter in the method will be corrupted as it will start to count again (unaware its in subreport) and consequently apply styles from "Main" report's title/subtitle or autotext in header. This is visible when you are not rendering title/subtitle on the subreport. The bug is present on docx. export - not sure why it works on .xls.

Here is how I fixed this (did some extends prior to exposing this method ofc):

    protected String createUniqueStyleName() {
        synchronized (this) {
            return "dj_style_" + Math.random();
        }
    }
bryantqo commented 2 years ago

Seeing this issue as well

juanalvarezg commented 1 year ago

able to reproduce!, fixed