/** * @deprecated Replaced by {@link JasperFillManager#fillReportToFile(String, Map, JRDataSource)}. */ public static String fillReportToFile( String sourceFileName, Map parameters, JRDataSource jrDataSource ) throws JRException { return JasperFillManager.fillReportToFile( sourceFileName, parameters, jrDataSource ); }
/** * @deprecated Replaced by {@link JasperFillManager#fillReportToFile(String, Map, Connection)}. */ public static String fillReportToFile( String sourceFileName, Map parameters, Connection conn ) throws JRException { return JasperFillManager.fillReportToFile( sourceFileName, parameters, conn ); }
/** * @deprecated Replaced by {@link JasperFillManager#fillReportToFile(JasperReport, String, Map, Connection)}. */ public static void fillReportToFile( JasperReport jasperReport, String destFileName, Map parameters, Connection conn ) throws JRException { JasperFillManager.fillReportToFile( jasperReport, destFileName, parameters, conn ); }
/** * @deprecated Replaced by {@link JasperFillManager#fillReportToFile(String, String, Map, JRDataSource)}. */ public static void fillReportToFile( String sourceFileName, String destFileName, Map parameters, JRDataSource jrDataSource ) throws JRException { JasperFillManager.fillReportToFile( sourceFileName, destFileName, parameters, jrDataSource ); }
/** * @deprecated Replaced by {@link JasperFillManager#fillReportToFile(String, String, Map, Connection)}. */ public static void fillReportToFile( String sourceFileName, String destFileName, Map parameters, Connection conn ) throws JRException { JasperFillManager.fillReportToFile( sourceFileName, destFileName, parameters, conn ); }
/** * @deprecated Replaced by {@link JasperFillManager#fillReportToFile(JasperReport, String, Map, JRDataSource)}. */ public static void fillReportToFile( JasperReport jasperReport, String destFileName, Map parameters, JRDataSource jrDataSource ) throws JRException { JasperFillManager.fillReportToFile( jasperReport, destFileName, parameters, jrDataSource ); }
/** * 填充数据源到模板中 * @param jasperFile jasper文件 * @param params 模板所需的参数 * @param dataSource 模板所需的数据源 * @param <T> 数据源泛型 * @return 填充模板后获取的.jasperprint文件的文件名 * @throws JRException JasperReport异常 */ private static <T> String getJasperPrintFile(String jasperFile, Map<String, Object> params, List<T> dataSource) throws JRException { return JasperFillManager.fillReportToFile(jasperFile, params, new JRBeanCollectionDataSource(dataSource)); }
/** * Fills the compiled report design loaded from the file received as the first parameter * and places the result in the file specified by the second parameter. * * @param sourceFileName source file containing the compile report design * @param destFileName file name to place the generated report into * @param parameters report parameters map * @see JRFiller#fillReport(JasperReport, Map) */ public static void fillReportToFile( String sourceFileName, String destFileName, Map parameters ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = setFileResolver(sourceFile, parameters); fillReportToFile(jasperReport, destFileName, parameters); }
/** * Fills the compiled report design loaded from the file received as the first parameter * and places the result in the file specified by the second parameter. * * @param sourceFileName source file containing the compile report design * @param destFileName file name to place the generated report into * @param parameters report parameters map * @param dataSource data source object */ public static void fillReportToFile( String sourceFileName, String destFileName, Map parameters, JRDataSource dataSource ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = setFileResolver(sourceFile, parameters); fillReportToFile(jasperReport, destFileName, parameters, dataSource); }
/** * Fills the compiled report design loaded from the specified file. * The result of this operation is another file that will contain the serialized * {@link JasperPrint} object representing the generated document, * having the same name as the report design as declared in the source file, * plus the <code>*.jrprint</code> extension, located in the same directory as the source file. * * @param sourceFileName source file containing the compile report design * @param parameters report parameters map * @see JRFiller#fillReport(JasperReport, Map) */ public static String fillReportToFile( String sourceFileName, Map parameters ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperReport.getName() + ".jrprint"); String destFileName = destFile.toString(); parameters = setFileResolver(sourceFile, parameters); fillReportToFile(jasperReport, destFileName, parameters); return destFileName; }
/** * Fills the compiled report design loaded from the file received as the first parameter * and places the result in the file specified by the second parameter. * * @param sourceFileName source file containing the compile report design * @param destFileName file name to place the generated report into * @param parameters report parameters map * @param connection JDBC connection object to use for executing the report internal SQL query */ public static void fillReportToFile( String sourceFileName, String destFileName, Map parameters, Connection connection ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = setFileResolver(sourceFile, parameters); fillReportToFile(jasperReport, destFileName, parameters, connection); }
/** * Fills the compiled report design loaded from the specified file. * The result of this operation is another file that will contain the serialized * {@link JasperPrint} object representing the generated document, * having the same name as the report design as declared in the source file, * plus the <code>*.jrprint</code> extension, located in the same directory as the source file. * * @param sourceFileName source file containing the compile report design * @param parameters report parameters map * @param connection JDBC connection object to use for executing the report internal SQL query */ public static String fillReportToFile( String sourceFileName, Map parameters, Connection connection ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperReport.getName() + ".jrprint"); String destFileName = destFile.toString(); parameters = setFileResolver(sourceFile, parameters); fillReportToFile(jasperReport, destFileName, parameters, connection); return destFileName; }
/** * Fills the compiled report design loaded from the specified file. * The result of this operation is another file that will contain the serialized * {@link JasperPrint} object representing the generated document, * having the same name as the report design as declared in the source file, * plus the <code>*.jrprint</code> extension, located in the same directory as the source file. * * @param sourceFileName source file containing the compile report design * @param parameters report parameters map * @param dataSource data source object */ public static String fillReportToFile( String sourceFileName, Map parameters, JRDataSource dataSource ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperReport.getName() + ".jrprint"); String destFileName = destFile.toString(); parameters = setFileResolver(sourceFile, parameters); fillReportToFile(jasperReport, destFileName, parameters, dataSource); return destFileName; }
final Connection connection = DataSourceFactory.getInstance().getConnection(); db.watch(connection); JasperFillManager.fillReportToFile(jasperReport, outputFileName, reportParms, connection); } finally { db.cleanUp(); JasperFillManager.fillReportToFile(jasperReport, outputFileName, reportParms, new JREmptyDataSource()); } else { throw new ReportException("No suitable datasource configured for report " + reportId);
final Connection connection = DataSourceFactory.getInstance().getConnection(); db.watch(connection); JasperFillManager.fillReportToFile(jasperReport, outputFileName, reportParms, connection); } finally { db.cleanUp(); JasperFillManager.fillReportToFile(jasperReport, outputFileName, reportParms, new JREmptyDataSource()); } else { throw new ReportException("No suitable datasource configured for report " + reportId);