1
I am doing a project to facilitate the creation of reports with DynamicJasper
and got to a part where I have to position an element that is in Band PageHeader
manually, setting the position X and Y, and this is done after the generation of the report by DynamicJasper
, the problem is that after I position the element the height of the Band PageHeader
remains the same with the element in another position and there remains an empty space between the Band PageHeader
and the others Bands
below.
So I was wondering if it’s possible to set the height
of Band PageHeader
dynamically so that this empty space is not left?
Final code where I build the report DynamicJasper
and where I want to do it:
final DynamicReport dynamicReport = this.fastReportBuilder.build();
dynamicReport.setAllowDetailSplit(true);
final JasperReport jasperReport = DynamicJasperHelper.generateJasperReport(dynamicReport, new ClassicLayoutManager(), null);
((JRDesignBand) jasperReport.getPageHeader()).setHeight(200); // <- Não funciona :S
final JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, new JRBeanCollectionDataSource(dados));
this.templateBuilder.setPageObjectsPosition(jasperPrint);
//... more code ...//