/** * 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 specified file and returns * the generated report object. * * @param sourceFileName source file containing the compile report design * @param parameters report parameters map * @return generated report object * @see JRFiller#fillReport(JasperReport, Map) */ public static JasperPrint fillReport( String sourceFileName, Map parameters ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = setFileResolver(sourceFile, parameters); return fillReport(jasperReport, parameters); }
/** * Fills the compiled report design loaded from the specified file and returns * the generated report object. * * @param sourceFileName source file containing the compile report design * @param parameters report parameters map * @param dataSource data source object * @return generated report object */ public static JasperPrint fillReport( String sourceFileName, Map parameters, JRDataSource dataSource ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = setFileResolver(sourceFile, parameters); return fillReport(jasperReport, parameters, dataSource); }
/** * Fills the compiled report design loaded from the specified file and returns * the generated report object. * * @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 * @return generated report object */ public static JasperPrint fillReport( String sourceFileName, Map parameters, Connection connection ) throws JRException { File sourceFile = new File(sourceFileName); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = setFileResolver(sourceFile, parameters); return fillReport(jasperReport, parameters, connection); }
/** * 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 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 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; }
/** * Fills a report and saves it directly into a PDF file. * The intermediate JasperPrint object is not saved on disk. */ public static String runReportToPdfFile( String sourceFileName, Map parameters, Connection conn ) throws JRException { File sourceFile = new File(sourceFileName); /* */ JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = JasperFillManager.setFileResolver(sourceFile, parameters); /* */ JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn); /* */ File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pdf"); String destFileName = destFile.toString(); JasperExportManager.exportReportToPdfFile(jasperPrint, destFileName); return destFileName; }
/** * Fills a report and saves it directly into a HTML file. * The intermediate JasperPrint object is not saved on disk. */ public static String runReportToHtmlFile( String sourceFileName, Map parameters, JRDataSource jrDataSource ) throws JRException { File sourceFile = new File(sourceFileName); /* */ JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = JasperFillManager.setFileResolver(sourceFile, parameters); /* */ JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, jrDataSource); /* */ File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".html"); String destFileName = destFile.toString(); JasperExportManager.exportReportToHtmlFile(jasperPrint, destFileName); return destFileName; }
/** * Fills a report and saves it directly into a PDF file. * The intermediate JasperPrint object is not saved on disk. */ public static String runReportToPdfFile( String sourceFileName, Map parameters, JRDataSource jrDataSource ) throws JRException { File sourceFile = new File(sourceFileName); /* */ JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = JasperFillManager.setFileResolver(sourceFile, parameters); /* */ JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, jrDataSource); /* */ File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pdf"); String destFileName = destFile.toString(); JasperExportManager.exportReportToPdfFile(jasperPrint, destFileName); return destFileName; }
/** * Fills a report and saves it directly into a HTML file. * The intermediate JasperPrint object is not saved on disk. */ public static String runReportToHtmlFile( String sourceFileName, Map parameters, Connection conn ) throws JRException { File sourceFile = new File(sourceFileName); /* */ JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = JasperFillManager.setFileResolver(sourceFile, parameters); /* */ JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn); /* */ File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".html"); String destFileName = destFile.toString(); JasperExportManager.exportReportToHtmlFile(jasperPrint, destFileName); return destFileName; }
/** * Fills a report and saves it directly into a PDF file. * The intermediate JasperPrint object is not saved on disk. * * @param sourceFileName the name of the compiled report file * @param parameters the parameters map * @return the name of the generated PDF file * @throws JRException * @see net.sf.jasperreports.engine.fill.JRFiller#fillReport(JasperReport, Map) */ public static String runReportToPdfFile( String sourceFileName, Map parameters ) throws JRException { File sourceFile = new File(sourceFileName); /* */ JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = JasperFillManager.setFileResolver(sourceFile, parameters); /* */ JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters); /* */ File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".pdf"); String destFileName = destFile.toString(); JasperExportManager.exportReportToPdfFile(jasperPrint, destFileName); return destFileName; }
/** * Fills a report and saves it directly into a HTML file. * The intermediate JasperPrint object is not saved on disk. * * @param sourceFileName the name of the compiled report file * @param parameters the parameters map * @return the name of the generated HTML file * @throws JRException * @see net.sf.jasperreports.engine.fill.JRFiller#fillReport(JasperReport, Map) */ public static String runReportToHtmlFile( String sourceFileName, Map parameters ) throws JRException { File sourceFile = new File(sourceFileName); /* */ JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); parameters = JasperFillManager.setFileResolver(sourceFile, parameters); /* */ JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters); /* */ File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".html"); String destFileName = destFile.toString(); JasperExportManager.exportReportToHtmlFile(jasperPrint, destFileName); return destFileName; }