Really the only reason is the verification of the content being actually a valid excel file. Although I can come up with something else during the template upload to verify that and not do it here.
On 8/6/2010 10:55 AM, Mark Fortner wrote:
Is there some reason that you're not using File.copy? Mark On Fri, Aug 6, 2010 at 6:31 AM, Aram Mirzadeh<[email protected]> wrote:Hi, I have a template XSLM file that I use as the basis for the output file. In HSSF I just duplicated the workbook via: private static POIFSFileSystem duplicateTemplate(final String outputExcelFile, final String templateFile) { POIFSFileSystem fs = null; FileOutputStream output = null; try { output = new FileOutputStream(outputExcelFile); } catch (final FileNotFoundException e) { logger.fatal("Fatal error file not found", e); System.exit(-1); } HSSFWorkbook wb = null; try { fs = new POIFSFileSystem(new FileInputStream(templateFile)); wb = new HSSFWorkbook(fs); } catch (final Exception e) { logger.fatal("FATAL: " + e); System.exit(-1); } try { wb.write(output); output.close(); } catch (final IOException e) { logger.fatal("Error while closing out file", e); System.exit(-1); } return (fs); } In XSSF this seems to be a lot more difficult. Am I missing something? Is there a helper that allows duplication of a full workbook to another without having to go through everything recursively? Thanks. Aram --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
