Class JasperReportBuilder
java.lang.Object
ch.unibas.medizin.dynamicreports.report.builder.AbstractBuilder<JasperReportBuilder, DRReport>
ch.unibas.medizin.dynamicreports.report.builder.ReportBuilder<JasperReportBuilder>
ch.unibas.medizin.dynamicreports.jasper.builder.JasperReportBuilder
- All Implemented Interfaces:
Serializable
The most used report builder for creating reports. It allows constructing and customizing the whole report content. A report consists of bands, columns, subtotals, groups, and other parts. Each
part is created and configured using a particular builder method, and it's passed to the report builder instance.
- Author:
- Ricardo Mariaca
- See Also:
-
Field Summary
Fields inherited from class AbstractBuilder
builded -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexport(AbstractJasperExporterBuilder<?, ? extends AbstractJasperExporter> exporterBuilder) export.Getter for the fieldconnection.net.sf.jasperreports.engine.JRDataSourceGetter for the fielddataSource.getJasperParameters.print()print.print(boolean withPrintDialog) print.rebuild()rebuild.setConnection(Connection connection) Setter for the fieldconnection.setDataSource(QueryBuilder query, Connection connection) Sets a database data source.setDataSource(String sql, Connection connection) Sets a database data source.setDataSource(ResultSet resultSet) Sets a database data source.setDataSource(Collection<?> collection) Sets a data source object.setDataSource(net.sf.jasperreports.engine.JRDataSource dataSource) Sets a data source object.setParameter(String name, Object value) setParameters(Map<String, Object> parameters) setStartPageNumber(Integer startPageNumber) Setter for the fieldstartPageNumber.setTemplateDesign(File file) setTemplateDesign.setTemplateDesign(InputStream inputStream) setTemplateDesign.setTemplateDesign(String fileName) setTemplateDesign.setTemplateDesign(URL jasperDesignUrl) setTemplateDesign.setTemplateDesign(net.sf.jasperreports.engine.design.JasperDesign jasperDesign) setTemplateDesign.setVirtualizer(net.sf.jasperreports.engine.JRVirtualizer virtualizer) Setter for the fieldvirtualizer.show()show.show(boolean exitOnClose) show.showJrXml.toCsv(JasperCsvExporterBuilder csvExporterBuilder) toCsv.toCsv(OutputStream outputStream) toCsv.toDocx(JasperDocxExporterBuilder docxExporterBuilder) toDocx.toDocx(OutputStream outputStream) toDocx.toHtml(JasperHtmlExporterBuilder htmlExporterBuilder) toHtml.toHtml(OutputStream outputStream) toHtml.toImage(JasperImageExporterBuilder imageExporterBuilder) toImage.toImage(OutputStream outputStream, ImageType imageType) toImage.net.sf.jasperreports.engine.design.JasperDesigntoJasperDesign.net.sf.jasperreports.engine.JasperPrinttoJasperPrint.net.sf.jasperreports.engine.JasperReporttoJasperReport.toJrXml(OutputStream outputStream) toJrXml.toJson(JasperJsonExporterBuilder jsonExporterBuilder) toJson.toJson(OutputStream outputStream) toJson.toOds(JasperOdsExporterBuilder odsExporterBuilder) toOds.toOds(OutputStream outputStream) toOds.toOdt(JasperOdtExporterBuilder odtExporterBuilder) toOdt.toOdt(OutputStream outputStream) toOdt.toPdf(JasperPdfExporterBuilder pdfExporterBuilder) toPdf.toPdf(OutputStream outputStream) toPdf.toPptx(JasperPptxExporterBuilder pptxExporterBuilder) toPptx.toPptx(OutputStream outputStream) toPptx.toRtf(JasperRtfExporterBuilder rtfExporterBuilder) toRtf.toRtf(OutputStream outputStream) toRtf.toText(JasperTextExporterBuilder textExporterBuilder) toText.toText(OutputStream outputStream) toText.toXlsx(JasperXlsxExporterBuilder xlsxExporterBuilder) toXlsx.toXlsx(OutputStream outputStream) toXlsx.toXml(JasperXmlExporterBuilder xmlExporterBuilder) toXml.toXml(OutputStream outputStream) toXml.Methods inherited from class ReportBuilder
addBackground, addColumn, addColumnFooter, addColumnHeader, addDetail, addDetailFooter, addDetailHeader, addDetailRowHighlighter, addField, addField, addField, addGroup, addGroupFooter, addGroupHeader, addLastPageFooter, addNoData, addPageFooter, addPageHeader, addParameter, addParameter, addParameter, addProperty, addScriptlet, addSort, addSubtotalAtColumnFooter, addSubtotalAtColumnHeader, addSubtotalAtFirstGroupFooter, addSubtotalAtFirstGroupHeader, addSubtotalAtGroupFooter, addSubtotalAtGroupHeader, addSubtotalAtLastGroupFooter, addSubtotalAtLastGroupHeader, addSubtotalAtLastPageFooter, addSubtotalAtPageFooter, addSubtotalAtPageHeader, addSubtotalAtSummary, addSubtotalAtTitle, addSubtotalOfPercentageAtGroupFooter, addSubtotalOfPercentageAtGroupHeader, addSummary, addTemplateStyle, addTemplateStyle, addTitle, addVariable, background, columnFooter, columnGrid, columnGrid, columnGrid, columnHeader, columns, detail, detailFooter, detailHeader, detailRowHighlighters, fields, floatColumnFooter, getReport, groupBy, groupBy, groupFooter, groupHeader, highlightDetailEvenRows, highlightDetailOddRows, ignorePageWidth, ignorePagination, lastPageFooter, noData, pageFooter, pageHeader, parameters, scriptlets, setBackgroundBackgroundComponent, setBackgroundPrintWhenExpression, setBackgroundSplitType, setBackgroundStyle, setChartStyle, setColumnDirection, setColumnFooterBackgroundComponent, setColumnFooterPrintWhenExpression, setColumnFooterSplitType, setColumnFooterStyle, setColumnHeaderBackgroundComponent, setColumnHeaderPrintWhenExpression, setColumnHeaderSplitType, setColumnHeaderStyle, setColumnStyle, setColumnTitleStyle, setDefaultFont, setDetailBackgroundComponent, setDetailEvenRowStyle, setDetailFooterBackgroundComponent, setDetailFooterPrintWhenExpression, setDetailFooterSplitType, setDetailFooterStyle, setDetailHeaderBackgroundComponent, setDetailHeaderPrintWhenExpression, setDetailHeaderSplitType, setDetailHeaderStyle, setDetailOddRowStyle, setDetailPrintWhenExpression, setDetailSplitType, setDetailStyle, setFilterExpression, setFloatColumnFooter, setGroupFooterBackgroundComponent, setGroupFooterPrintWhenExpression, setGroupFooterSplitType, setGroupFooterStyle, setGroupHeaderBackgroundComponent, setGroupHeaderPrintWhenExpression, setGroupHeaderSplitType, setGroupHeaderStyle, setGroupStyle, setGroupTitleStyle, setHighlightDetailEvenRows, setHighlightDetailOddRows, setIgnorePageWidth, setIgnorePagination, setImageStyle, setLanguage, setLastPageFooterBackgroundComponent, setLastPageFooterPrintWhenExpression, setLastPageFooterSplitType, setLastPageFooterStyle, setLocale, setNoDataBackgroundComponent, setNoDataPrintWhenExpression, setNoDataSplitType, setNoDataStyle, setPageColumnSpace, setPageColumnsPerPage, setPageFooterBackgroundComponent, setPageFooterPrintWhenExpression, setPageFooterSplitType, setPageFooterStyle, setPageFormat, setPageFormat, setPageFormat, setPageHeaderBackgroundComponent, setPageHeaderPrintWhenExpression, setPageHeaderSplitType, setPageHeaderStyle, setPageMargin, setPrintOrder, setProperties, setQuery, setQuery, setQuery, setReportName, setResourceBundle, setResourceBundle, setShowColumnTitle, setShowColumnValues, setSubtotalStyle, setSummaryBackgroundComponent, setSummaryOnANewPage, setSummaryPrintWhenExpression, setSummarySplitType, setSummaryStyle, setSummaryWithPageHeaderAndFooter, setTableOfContents, setTableOfContents, setTableOfContents, setTemplate, setTextStyle, setTitleBackgroundComponent, setTitleOnANewPage, setTitlePrintWhenExpression, setTitleSplitType, setTitleStyle, setUseFieldNameAsDescription, setWhenNoDataType, setWhenResourceMissingType, sortBy, sortBy, subtotalsAtColumnFooter, subtotalsAtColumnHeader, subtotalsAtFirstGroupFooter, subtotalsAtFirstGroupHeader, subtotalsAtGroupFooter, subtotalsAtGroupHeader, subtotalsAtLastGroupFooter, subtotalsAtLastGroupHeader, subtotalsAtLastPageFooter, subtotalsAtPageFooter, subtotalsAtPageHeader, subtotalsAtSummary, subtotalsAtTitle, subtotalsOfPercentageAtGroupFooter, subtotalsOfPercentageAtGroupHeader, summary, summaryOnANewPage, summaryWithPageHeaderAndFooter, tableOfContents, tableOfContents, tableOfContents, templateStyles, templateStyles, title, titleOnANewPage, variablesMethods inherited from class AbstractBuilder
build, configure, getObject
-
Constructor Details
-
JasperReportBuilder
public JasperReportBuilder()Constructor for JasperReportBuilder.
-
-
Method Details
-
setStartPageNumber
Setter for the field
startPageNumber.- Parameters:
startPageNumber- aIntegerobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
setDataSource
Sets a data source object. Creates a new JRBeanCollectionDataSource data source object.- Parameters:
collection- - the collection values- Returns:
- a report builder
-
setDataSource
Sets a database data source. In this type of data source, data are retrieved from a database.- Parameters:
resultSet- - the resultSet object- Returns:
- a report builder
-
setDataSource
Sets a database data source. In this type of data source, data are retrieved from a database.- Parameters:
sql- - the sql queryconnection- - the database connection- Returns:
- a report builder
-
setDataSource
Sets a database data source. In this type of data source, data are retrieved from a database.- Parameters:
query- - the query definitionconnection- - the database connection- Returns:
- a report builder
-
setTemplateDesign
setTemplateDesign.
- Parameters:
inputStream- aInputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
setTemplateDesign
setTemplateDesign.
- Parameters:
file- aFileobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
setTemplateDesign
setTemplateDesign.
- Parameters:
fileName- aStringobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
setTemplateDesign
public JasperReportBuilder setTemplateDesign(net.sf.jasperreports.engine.design.JasperDesign jasperDesign) throws DRException setTemplateDesign.
- Parameters:
jasperDesign- aJasperDesignobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
setTemplateDesign
setTemplateDesign.
- Parameters:
jasperDesignUrl- aURLobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
setParameter
- Overrides:
setParameterin classReportBuilder<JasperReportBuilder>
-
setParameters
- Overrides:
setParametersin classReportBuilder<JasperReportBuilder>
-
rebuild
rebuild.
- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toJasperDesign
toJasperDesign.
- Returns:
- a
JasperDesignobject. - Throws:
DRException- if any.
-
toJasperReport
toJasperReport.
- Returns:
- a
JasperReportobject. - Throws:
DRException- if any.
-
getJasperParameters
getJasperParameters.
- Returns:
- a
Mapobject. - Throws:
DRException- if any.
-
toJasperPrint
toJasperPrint.
- Returns:
- a
JasperPrintobject. - Throws:
DRException- if any.
-
show
show.
- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
show
show.
- Parameters:
exitOnClose- a boolean.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
showJrXml
showJrXml.
- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toJrXml
toJrXml.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
print
print.
- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
print
print.
- Parameters:
withPrintDialog- a boolean.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
setVirtualizer
Setter for the field
virtualizer.- Parameters:
virtualizer- aJRVirtualizerobject.- Returns:
- a
JasperReportBuilderobject.
-
toImage
public JasperReportBuilder toImage(OutputStream outputStream, ImageType imageType) throws DRException toImage.
- Parameters:
outputStream- aOutputStreamobject.imageType- aImageTypeobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toImage
public JasperReportBuilder toImage(JasperImageExporterBuilder imageExporterBuilder) throws DRException toImage.
- Parameters:
imageExporterBuilder- aJasperImageExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toCsv
toCsv.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toCsv
toCsv.
- Parameters:
csvExporterBuilder- aJasperCsvExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toDocx
toDocx.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toDocx
toDocx.
- Parameters:
docxExporterBuilder- aJasperDocxExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toHtml
toHtml.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toHtml
toHtml.
- Parameters:
htmlExporterBuilder- aJasperHtmlExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toJson
toJson.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toJson
toJson.
- Parameters:
jsonExporterBuilder- aJasperJsonExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toOds
toOds.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toOds
toOds.
- Parameters:
odsExporterBuilder- aJasperOdsExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toOdt
toOdt.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toOdt
toOdt.
- Parameters:
odtExporterBuilder- aJasperOdtExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toPdf
toPdf.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toPdf
toPdf.
- Parameters:
pdfExporterBuilder- aJasperPdfExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toRtf
toRtf.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toRtf
toRtf.
- Parameters:
rtfExporterBuilder- aJasperRtfExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toText
toText.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toText
toText.
- Parameters:
textExporterBuilder- aJasperTextExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toXlsx
toXlsx.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toXlsx
toXlsx.
- Parameters:
xlsxExporterBuilder- aJasperXlsxExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toXml
toXml.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toXml
toXml.
- Parameters:
xmlExporterBuilder- aJasperXmlExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toPptx
toPptx.
- Parameters:
outputStream- aOutputStreamobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
toPptx
toPptx.
- Parameters:
pptxExporterBuilder- aJasperPptxExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
export
public JasperReportBuilder export(AbstractJasperExporterBuilder<?, ? extends AbstractJasperExporter> exporterBuilder) throws DRException export.
- Parameters:
exporterBuilder- aAbstractJasperExporterBuilderobject.- Returns:
- a
JasperReportBuilderobject. - Throws:
DRException- if any.
-
getConnection
-
setConnection
Setter for the field
connection.- Parameters:
connection- aConnectionobject.- Returns:
- a
JasperReportBuilderobject.
-
getDataSource
public net.sf.jasperreports.engine.JRDataSource getDataSource()Getter for the field
dataSource.- Returns:
- a
JRDataSourceobject.
-
setDataSource
Sets a data source object.- Parameters:
dataSource- - the JRDataSource object- Returns:
- a report builder
-