本文整理汇总了Java中net.sf.dynamicreports.report.builder.component.SubreportBuilder类的典型用法代码示例。如果您正苦于以下问题:Java SubreportBuilder类的具体用法?Java SubreportBuilder怎么用?Java SubreportBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SubreportBuilder类属于net.sf.dynamicreports.report.builder.component包,在下文中一共展示了SubreportBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureReport
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) throws DRException {
Map<String, Object> parameters1 = new HashMap<String, Object>();
parameters1.put("parameter5", "value5");
parameters1.put("parameter6", "value6");
Map<String, Object> parameters2 = new HashMap<String, Object>();
parameters2.put("parameter5", "value7");
SubreportBuilder subreport1 = cmp.subreport(subreport1())
.setParameters(parameters1);
SubreportBuilder subreport2 = cmp.subreport(subreport2())
.setParameters(parameters2);
rb.addParameter("parameter4", "value4")
.title(subreport1, subreport2);
}
示例2: configureReport
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
SubreportBuilder subreport = cmp.subreport(titleSubreport())
.setDataSource(new SubreportDataSourceExpression());
rb.detail(subreport)
.pageFooter(
cmp.pageNumber(),
cmp.totalPages(),
cmp.pageXslashY(),
cmp.pageXofY(),
cmp.pageXofY().setFormatExpression("Page {0} of {1}"),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.LEFT),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.RIGHT),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.JUSTIFIED),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.CENTER));
}
示例3: build
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
private void build() {
SubreportBuilder subreport = cmp.subreport(createSubreport())
.setDataSource(exp.subDatasourceBeanCollection("subData"));
try {
report()
.setTemplate(Templates.reportTemplate)
.columns(
col.column("Item", "item", type.stringType()),
col.column("Quantity", "quantity", type.integerType()),
col.column("Unit price", "unitPrice", type.bigDecimalType()))
.title(Templates.createTitleComponent("CollectionDatasource"))
.detailFooter(
cmp.horizontalList(cmp.horizontalGap(150), subreport, cmp.horizontalGap(150)),
cmp.line())
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
示例4: build
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
private void build() {
SubreportBuilder subreport = cmp.subreport(new SubreportDesign())
.setDataSource(new SubreportData());
try {
report()
.setTemplate(Templates.reportTemplate)
.fields(field("comments", List.class))
.columns(
col.column("Item", "item", type.stringType()),
col.column("Quantity", "quantity", type.integerType()),
col.componentColumn("Comments", subreport))
.title(Templates.createTitleComponent("ColumnSubreportData"))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
示例5: build
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
private void build() {
SubreportBuilder subreport = cmp.subreport(new SubreportExpression())
.setDataSource(new SubreportDataSourceExpression());
try {
report()
.title(Templates.createTitleComponent("DetailDynamicSubreport"))
.detail(
subreport,
cmp.verticalGap(20))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
示例6: build
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
protected JasperPrint build() throws ProcessingException {
if (content == null) {
throw new IllegalArgumentException("content must be set");
}
if (headerFooterTemplatePath == null) {
throw new IllegalArgumentException("Default Header/Footer Template is missing");
}
try {
String reportDir = IOUtility.getFilePath(headerFooterTemplatePath);
TemplateStylesBuilder styles = DynamicReports.stl.loadStyles(reportDir + FMilaUtility.FILE_SEPARATOR + "styles.jrtx");
tableLeft = styles.getStyle("table.left");
tableRight = styles.getStyle("table.right");
int size = content.size();
SubreportBuilder tableSubreport = cmp.subreport(new TableSubreportExpression()).setDataSource(new TableSubreportDataSourceExpression(content));
JasperReportBuilder report = DynamicReports.report().setTemplate(DynamicTemplate.reportTemplate).setParameters(parameters).detail(tableSubreport, cmp.verticalGap(20)).setDataSource(new JREmptyDataSource(size));
// Header Footer
InputStream headerFooterTemplate = new FileInputStream(headerFooterTemplatePath);
report.setTemplateDesign(headerFooterTemplate);
return report.toJasperPrint();
}
catch (DRException | FileNotFoundException e) {
throw new ProcessingException("Failed creating Report", e);
}
}
示例7: alterationEvidenceTable
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@NotNull
private static ComponentBuilder<?, ?> alterationEvidenceTable() {
final int ALTERATION_WIDTH = 130;
final int SIGNIFICANCE_WIDTH = 100;
final int SOURCE_WIDTH = 70;
//@formatter:off
final SubreportBuilder subtable = cmp.subreport(
baseTable().setColumnStyle(dataStyle()).fields(AlterationEvidence.SOURCE_URL)
.columns(
col.column(AlterationEvidence.SIGNIFICANCE).setFixedWidth(SIGNIFICANCE_WIDTH).setMinHeight(25),
col.column(AlterationEvidence.DRUGS),
col.column(AlterationEvidence.SOURCE).setHyperLink(hyperLink(AlterationEvidence.sourceHyperlink()))
.setStyle(dataLinkStyle()).setFixedWidth(SOURCE_WIDTH)))
.setDataSource(exp.subDatasourceBeanCollection("evidence"));
final ComponentBuilder<?, ?> tableHeader = cmp.horizontalList(
cmp.text("Alteration").setStyle(tableHeaderStyle()).setFixedWidth(ALTERATION_WIDTH),
cmp.text("Significance").setStyle(tableHeaderStyle()).setFixedWidth(SIGNIFICANCE_WIDTH),
cmp.text("Association(Lv)").setStyle(tableHeaderStyle()),
cmp.text("Source").setStyle(tableHeaderStyle()).setFixedWidth(SOURCE_WIDTH));
return cmp.subreport(
baseTable().setColumnStyle(dataStyle()).title(tableHeader)
.columns(
col.column(Alteration.ALTERATION).setFixedWidth(ALTERATION_WIDTH),
col.componentColumn(subtable))
.noData(cmp.text("None").setStyle(fontStyle().setHorizontalTextAlignment(HorizontalTextAlignment.CENTER))))
.setDataSource(exp.subDatasourceBeanCollection("alterationsWithEvidence"));
// @formatter:on
}
示例8: configureReport
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
SubreportBuilder subreport = cmp.subreport(new SubreportExpression());
subreport.setConnection(connection);
CustomGroupBuilder group = grp.group(field("field4", Integer.class));
group.footer(subreport);
rb.groupBy(group)
.setDataSource("SELECT * FROM test_table2", connection);
}
示例9: evaluate
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
public JasperReportBuilder evaluate(ReportParameters reportParameters) {
SubreportBuilder subreport = Components.subreport(new Subreport2Expression());
JasperReportBuilder report = report();
report
.title(
cmp.text(reportParameters.getSubreportWidth()),
cmp.horizontalList(cmp.horizontalGap(10 * reportParameters.getReportRowNumber()), subreport));
return report;
}
示例10: configureReport
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
SubreportBuilder subreport = Components.subreport(new SubreportExpression())
.setDataSource(new SubreportDataSourceExpression());
rb.detail(subreport);
}
示例11: configureReport
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
SubreportBuilder subreport = Components.subreport(new SubreportExpression())
.setDataSource(new SubreportDataSourceExpression());
rb.detail(subreport);
}
示例12: configureReport
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
SubreportBuilder detailSubreport = cmp.subreport(detailSubreport())
.setDataSource(new SubreportDataSourceExpression());
rb.title(cmp.subreport(titleSubreport()))
.detail(detailSubreport);
}
示例13: configureReport
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
SubreportBuilder subreport1 = cmp.subreport(subreport1());
subreport1.setDataSource(createSubreport1DataSource());
rb.fields(field("f1", Integer.class))
.detail(subreport1);
}
示例14: subreport1
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
private JasperReportBuilder subreport1() {
SubreportBuilder subreport2 = cmp.subreport(subreport2());
JasperReportBuilder report = report();
report
.fields(field("f2", Integer.class))
.setPageMargin(margin(0))
.detail(subreport2);
return report;
}
示例15: configureReport
import net.sf.dynamicreports.report.builder.component.SubreportBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
SubreportBuilder subreport = Components.subreport(new SubreportExpression())
.setDataSource(new SubreportDataSourceExpression());
rb.detail(
subreport,
cmp.filler().setFixedHeight(20))
.summary(cmp.subreport(subreport2()));
}