我想在DynamicJasper中设置一个不带组的子报表。当放置组时,将创建新行。 (参见图片)。我试图插入addConcatenatedReport,但仅显示子报表。我想把报告放在同一行。谢谢!
FastReportBuilder drb = new FastReportBuilder();
drb.addColumn("Matrícula", "empMatr", Object.class.getName(), 5).addGroups(1)
.addColumn("Nome", "pessoaFisica.pesNome", String.class.getName(), 10)
.addColumn("Data Admissão", "dtAdmissao", Date.class.getName(), 5).setMargins(5, 5, 20, 20)
.setWhenNoDataAllSectionNoDetail();
drb.addField("familiares", List.class.getName());
DynamicReport drFooterSubreport = createFooterSubreport();
drb.addSubreportInGroupFooter(1, drFooterSubreport, new ClassicLayoutManager(), "familiares",
DJConstants.DATA_SOURCE_ORIGIN_FIELD, DJConstants.DATA_SOURCE_TYPE_COLLECTION);
drb.setUseFullPageWidth(true);
DynamicReport dr = drb.build();
JRDataSource ds = new JRBeanCollectionDataSource(empregados);
JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);
response.setCharacterEncoding("utf-8");
response.setContentType("application/pdf");
servletOutputStream = response.getOutputStream();
JasperExportManager.exportReportToPdfStream(jp, servletOutputStream);
servletOutputStream.flush();
servletOutputStream.close();
context.responseComplete();
context.renderResponse();
....
私有DynamicReport createFooterSubreport()引发异常{
FastReportBuilder rb = new FastReportBuilder();
DynamicReport dr = rb.addColumn("Nome Familiar", "famNome", String.class.getName(), 100)
.addColumn("Iden", "famIden", Long.class.getName(), 100).setDefaultStyles(titleStyleSubReport,
subTitleStyleSubReport, headerStyleSubReport, columnStyleSubReport)
.setMargins(5, 5, 20, 20).setUseFullPageWidth(true).build();
return dr;
}