Jasper:
http://jasperforge.org/website/jasperreportswebsite/trunk/index.html
IReport:
http://sourceforge.net/projects/ireport/
net.sf.jasperreports.engine.design.JasperDesign --> jrxml 文件
||
|| 编译
\/
net.sf.jasperreports.engine.JasperReport --> jasper 文件
||
|| 填充
\/
net.sf.jasperreports.engine.JasperPrint --> jrprint 文件
|| || ||
|| 导出 || 显示 || 打印
\/ \/ \/
html, PDF, excel panel
JasperCompileManager
.compileReport/compileReportToFile/compileReportToStream
n 输入 : inputStream/jasperDesign/jrxmlFileName
n 输出 ( 可选 ) : outputStream(ToStream), jasperFileName(ToFile)
n e.g. JasperCompileManager.compileReportToFile("sample_report.jrxml","sample_report.jasper");
JasperFillManager
.fillReport/fillReportToFile/fillReportToStream
n 输入 : inputStream/jasperReport/jasperFileName
n 输出 ( 可选 ) : outputStream(ToStream), jrprintFileName(ToFile)
n 参数: Map parameters
n 数据连接 ( 可选 ) : connection/dataSource
n e.g. JasperFillManager.fillReportToFile("sample_report.jasper", "sample_report.jrprint", null, new JREmptyDataSource());
JasperExportManager
.exportReportToHtmlFile/exportReportToPdf/exportReportToPdfFile/exportReportToPdfStream/exportReportToXml/exportReportToXmlFile/exportReportToXmlStream
n 输入 : jasperPrint/sourceFileName
n 输出 ( 可选 ) : outputStream(ToStream), destFileName(ToFile)
n 参数: Map parameters
n 数据连接 ( 可选 ) : connection/dataSource
n e.g. JasperFillManager.fillReportToFile("sample_report.jasper", "sample_report.jrprint", null, new JREmptyDataSource());
net.sf.jasperreports.engine.export.JR CsvExporter
JRPdfExporter
JRHtmlExporter
JRRtfExporter
JRTextExporter
JRXmlExporter
n 设置参数 e.g
exporter.setParameter(JRExporterParameter.JASPER_PRINT,
jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFileName);
n 导出 exporter.exportReport();
JRViewer
n 输入: inputStream/jasperReport/jasperFileName
n 是否是 XML : isXML
n 地域: Locale
n e.g. JPanel p = new JRViewer("sample_report.jrprint",false);
JasperPrintManager .printReport/printPageToImage/printPages/printPage/printReportToPdf/printReportToPdfFile/printReportToPdfStream/printReportToXml/printReportToXmlFile/printReportToXmlStream
n 输入 : jasperPrint/sourceFileName/inputStream
n 输出 ( 可选 ) : outputStream(ToStream), destFileName(ToFile)
n e.g. JasperPrintManager.printReport("sample_report.jrprint",false);
JasperRunManager
.runReportToHtmlFile/runReportToPdf/runReportToPdfFile/runReportToPdfStream
n 输入 : inputStream/jasperReport/jasperFileName
n 输出 ( 可选 ) : htmlFileName(ToHtmlFile), pdfFileName(ToPdfFile), outputStream(ToPdfStream)
n 参数: Map parameters
n 数据连接 ( 可选 ) : connection/dataSource
net.sf.jasperreports.engine.util.JRLoader.loadObject(inputStream/File/FileName)
$P{key} -> paraMap (key, value )
$R{key} -> messageBundle (key, value )
$F{fieldName} -> <field name=”” class=”” …/>
$V{varName}
<queryString><![CDATA[…]]></queryString>