net.sf.dynamicreports.jasper.builder
Class JasperReportBuilder
java.lang.Object
net.sf.dynamicreports.report.builder.AbstractBuilder<T,DRReport>
net.sf.dynamicreports.report.builder.ReportBuilder<JasperReportBuilder>
net.sf.dynamicreports.jasper.builder.JasperReportBuilder
- All Implemented Interfaces:
- Serializable
public class JasperReportBuilder
- extends ReportBuilder<JasperReportBuilder>
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 (r.mariaca@dynamicreports.org)
- See Also:
- Serialized Form
Methods inherited from class net.sf.dynamicreports.report.builder.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, setBarcodeStyle, 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, setChartStyle, 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, variables |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JasperReportBuilder
public JasperReportBuilder()
setStartPageNumber
public JasperReportBuilder setStartPageNumber(Integer startPageNumber)
throws DRException
- Throws:
DRException
setConnection
public JasperReportBuilder setConnection(Connection connection)
setDataSource
public JasperReportBuilder setDataSource(Collection<?> collection)
- Sets a data source object.
Creates a new JRBeanCollectionDataSource data source object.
- Parameters:
collection
- - the collection values
- Returns:
- a report builder
setDataSource
public JasperReportBuilder setDataSource(ResultSet resultSet)
- 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
public JasperReportBuilder setDataSource(String sql,
Connection connection)
- 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
public JasperReportBuilder setDataSource(QueryBuilder query,
Connection connection)
- 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
setDataSource
public JasperReportBuilder setDataSource(net.sf.jasperreports.engine.JRDataSource dataSource)
- Sets a data source object.
- Parameters:
dataSource
- - the JRDataSource object
- Returns:
- a report builder
setTemplateDesign
public JasperReportBuilder setTemplateDesign(InputStream inputStream)
throws DRException
- Throws:
DRException
setTemplateDesign
public JasperReportBuilder setTemplateDesign(File file)
throws DRException
- Throws:
DRException
setTemplateDesign
public JasperReportBuilder setTemplateDesign(String fileName)
throws DRException
- Throws:
DRException
setTemplateDesign
public JasperReportBuilder setTemplateDesign(net.sf.jasperreports.engine.design.JasperDesign jasperDesign)
throws DRException
- Throws:
DRException
setTemplateDesign
public JasperReportBuilder setTemplateDesign(URL jasperDesignUrl)
throws DRException
- Throws:
DRException
setParameter
public JasperReportBuilder setParameter(String name,
Object value)
- Overrides:
setParameter
in class ReportBuilder<JasperReportBuilder>
setParameters
public JasperReportBuilder setParameters(Map<String,Object> parameters)
- Overrides:
setParameters
in class ReportBuilder<JasperReportBuilder>
rebuild
public JasperReportBuilder rebuild()
throws DRException
- Throws:
DRException
toJasperDesign
public net.sf.jasperreports.engine.design.JasperDesign toJasperDesign()
throws DRException
- Throws:
DRException
toJasperReport
public net.sf.jasperreports.engine.JasperReport toJasperReport()
throws DRException
- Throws:
DRException
getJasperParameters
public Map<String,Object> getJasperParameters()
throws DRException
- Throws:
DRException
toJasperPrint
public net.sf.jasperreports.engine.JasperPrint toJasperPrint()
throws DRException
- Throws:
DRException
show
public JasperReportBuilder show()
throws DRException
- Throws:
DRException
show
public JasperReportBuilder show(boolean exitOnClose)
throws DRException
- Throws:
DRException
showJrXml
public JasperReportBuilder showJrXml()
throws DRException
- Throws:
DRException
toJrXml
public JasperReportBuilder toJrXml(OutputStream outputStream)
throws DRException
- Throws:
DRException
print
public JasperReportBuilder print()
throws DRException
- Throws:
DRException
print
public JasperReportBuilder print(boolean withPrintDialog)
throws DRException
- Throws:
DRException
setVirtualizer
public JasperReportBuilder setVirtualizer(net.sf.jasperreports.engine.JRVirtualizer virtualizer)
toImage
public JasperReportBuilder toImage(OutputStream outputStream,
ImageType imageType)
throws DRException
- Throws:
DRException
toImage
public JasperReportBuilder toImage(JasperImageExporterBuilder imageExporterBuilder)
throws DRException
- Throws:
DRException
toCsv
public JasperReportBuilder toCsv(OutputStream outputStream)
throws DRException
- Throws:
DRException
toCsv
public JasperReportBuilder toCsv(JasperCsvExporterBuilder csvExporterBuilder)
throws DRException
- Throws:
DRException
toDocx
public JasperReportBuilder toDocx(OutputStream outputStream)
throws DRException
- Throws:
DRException
toDocx
public JasperReportBuilder toDocx(JasperDocxExporterBuilder docxExporterBuilder)
throws DRException
- Throws:
DRException
toHtml
public JasperReportBuilder toHtml(OutputStream outputStream)
throws DRException
- Throws:
DRException
toHtml
public JasperReportBuilder toHtml(JasperHtmlExporterBuilder htmlExporterBuilder)
throws DRException
- Throws:
DRException
toOds
public JasperReportBuilder toOds(OutputStream outputStream)
throws DRException
- Throws:
DRException
toOds
public JasperReportBuilder toOds(JasperOdsExporterBuilder odsExporterBuilder)
throws DRException
- Throws:
DRException
toOdt
public JasperReportBuilder toOdt(OutputStream outputStream)
throws DRException
- Throws:
DRException
toOdt
public JasperReportBuilder toOdt(JasperOdtExporterBuilder odtExporterBuilder)
throws DRException
- Throws:
DRException
toPdf
public JasperReportBuilder toPdf(OutputStream outputStream)
throws DRException
- Throws:
DRException
toPdf
public JasperReportBuilder toPdf(JasperPdfExporterBuilder pdfExporterBuilder)
throws DRException
- Throws:
DRException
toRtf
public JasperReportBuilder toRtf(OutputStream outputStream)
throws DRException
- Throws:
DRException
toRtf
public JasperReportBuilder toRtf(JasperRtfExporterBuilder rtfExporterBuilder)
throws DRException
- Throws:
DRException
toText
public JasperReportBuilder toText(OutputStream outputStream)
throws DRException
- Throws:
DRException
toText
public JasperReportBuilder toText(JasperTextExporterBuilder textExporterBuilder)
throws DRException
- Throws:
DRException
toXhtml
public JasperReportBuilder toXhtml(OutputStream outputStream)
throws DRException
- Throws:
DRException
toXhtml
public JasperReportBuilder toXhtml(JasperXhtmlExporterBuilder xhtmlExporterBuilder)
throws DRException
- Throws:
DRException
toExcelApiXls
public JasperReportBuilder toExcelApiXls(OutputStream outputStream)
throws DRException
- Throws:
DRException
toExcelApiXls
public JasperReportBuilder toExcelApiXls(JasperExcelApiXlsExporterBuilder excelApiXlsExporterBuilder)
throws DRException
- Throws:
DRException
toXls
public JasperReportBuilder toXls(OutputStream outputStream)
throws DRException
- Throws:
DRException
toXls
public JasperReportBuilder toXls(JasperXlsExporterBuilder xlsExporterBuilder)
throws DRException
- Throws:
DRException
toXlsx
public JasperReportBuilder toXlsx(OutputStream outputStream)
throws DRException
- Throws:
DRException
toXlsx
public JasperReportBuilder toXlsx(JasperXlsxExporterBuilder xlsxExporterBuilder)
throws DRException
- Throws:
DRException
toXml
public JasperReportBuilder toXml(OutputStream outputStream)
throws DRException
- Throws:
DRException
toXml
public JasperReportBuilder toXml(JasperXmlExporterBuilder xmlExporterBuilder)
throws DRException
- Throws:
DRException
toPptx
public JasperReportBuilder toPptx(OutputStream outputStream)
throws DRException
- Throws:
DRException
toPptx
public JasperReportBuilder toPptx(JasperPptxExporterBuilder pptxExporterBuilder)
throws DRException
- Throws:
DRException
export
public JasperReportBuilder export(AbstractJasperExporterBuilder<?,? extends AbstractJasperExporter> exporterBuilder)
throws DRException
- Throws:
DRException
getConnection
public Connection getConnection()
getDataSource
public net.sf.jasperreports.engine.JRDataSource getDataSource()
Copyright © 2010-2014. All Rights Reserved.