WorkbookSettings ws = new WorkbookSettings(); ws.setEncoding("Cp1252"); Workbook workbook = Workbook.getWorkbook(stream, ws);
public XLSWorkbook( InputStream inputStream, String encoding ) throws KettleException { this.encoding = encoding; WorkbookSettings ws = new WorkbookSettings(); if ( !Utils.isEmpty( encoding ) ) { ws.setEncoding( encoding ); } try { workbook = Workbook.getWorkbook( inputStream, ws ); } catch ( Exception e ) { throw new KettleException( e ); } }
public XLSWorkbook( String filename, String encoding ) throws KettleException { this.filename = filename; this.encoding = encoding; WorkbookSettings ws = new WorkbookSettings(); if ( !Utils.isEmpty( encoding ) ) { ws.setEncoding( encoding ); } try { workbook = Workbook.getWorkbook( KettleVFS.getInputStream( filename ), ws ); } catch ( Exception e ) { throw new KettleException( e ); } }
data.realSheetname = environmentSubstitute( meta.getSheetname() ); data.ws = new WorkbookSettings(); if ( meta.isUseTempFiles() ) { data.ws.setUseTemporaryFileDuringWrite( true );
WorkbookSettings workbookSettings = new WorkbookSettings(); workbookSettings.setEncoding( "Cp1252" ); Workbook.getWorkbook( theFile, workbookSettings );
/** * write into excel file. * * @param map * @param testSummatyField * @throws IOException * @throws WriteException */ public void write(Map<String, TestResult> map, String[] testSummatyField) throws IOException, WriteException { log.info("Writing file : " + inputFile); File file = new File(inputFile); WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook = Workbook.createWorkbook(file, wbSettings); workbook.createSheet("PerformanceBenchmark", 0); WritableSheet excelSheet = workbook.getSheet(0); createLabel(excelSheet, testSummatyField); createContent(excelSheet, map); workbook.write(); workbook.close(); }
//Load template workbook with settings WorkbookSettings ws = new WorkbookSettings(); ws.setEncoding("Cp1252"); Workbook templateWorkbook = Workbook.getWorkbook(this.context.getAssets().open("template.xls"), ws); //Create new workbook from templateWorkbook without settings this.workbook = Workbook.createWorkbook(new File(this.location), templateWorkbook);
/** * A factory method which takes in an excel file and reads in the contents. * * @exception IOException * @exception BiffException * @param file the excel 97 spreadsheet to parse * @return a workbook instance */ public static Workbook getWorkbook(java.io.File file) throws IOException, BiffException { return getWorkbook(file, new WorkbookSettings()); }
/** * A factory method which takes in an excel file and reads in the contents. * * @param is an open stream which is the the excel 97 spreadsheet to parse * @return a workbook instance * @exception IOException * @exception BiffException */ public static Workbook getWorkbook(InputStream is) throws IOException, BiffException { return getWorkbook(is, new WorkbookSettings()); }
/** * Creates a writable workbook with the given file name * * @param file the workbook to copy * @return a writable workbook * @exception IOException */ public static WritableWorkbook createWorkbook(java.io.File file) throws IOException { return createWorkbook(file, new WorkbookSettings()); }
/** * Creates a writable workbook with the given file name * * @param file the workbook to copy * @return a writable workbook * @exception IOException */ public static WritableWorkbook createWorkbook(java.io.File file) throws IOException { return createWorkbook(file, new WorkbookSettings()); }
//Load template workbook with settings WorkbookSettings ws = new WorkbookSettings(); ws.setEncoding("Cp1252"); Workbook templateWorkbook = Workbook.getWorkbook(this.context.getAssets().open("template.xls"), ws); //Create new workbook from templateWorkbook without settings this.workbook = Workbook.createWorkbook(new File(this.location), templateWorkbook);
File file = new File(inputFile);//From File WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook = Workbook.createWorkbook(file, wbSettings); workbook.createSheet("Serial Numbers", 0);/To configuration
public static Sheet getSheet() throws BiffException, IOException { WorkbookSettings ws = new WorkbookSettings(); ws.setLocale(new Locale("en", "EN")); Workbook w = Workbook.getWorkbook(new File(inputFile),ws); Sheet s = w.getSheet(0); return s; }
public WriteAccess(java.io.File file) throws IOException, BiffException { WorkbookSettings ws = new WorkbookSettings(); FileInputStream fis = new FileInputStream(file); File f = new File(fis, ws); reader = new BiffRecordReader(f); display(ws); fis.close(); }
public WriteAccess(java.io.File file) throws IOException, BiffException { WorkbookSettings ws = new WorkbookSettings(); FileInputStream fis = new FileInputStream(file); File f = new File(fis, ws); reader = new BiffRecordReader(f); display(ws); fis.close(); }
/** * Opens a workbook with UTF-8 encoding. */ private static WritableWorkbook openWorkbook( OutputStream outputStream ) throws IOException { WorkbookSettings ws = new WorkbookSettings(); ws.setEncoding( "UTF-8" ); return Workbook.createWorkbook( outputStream, ws ); } }
WorkbookSettings settings = new WorkbookSettings(); settings.setGCDisabled( true ); settings.setUseTemporaryFileDuringWrite( true ); settings.setTemporaryFileDuringWriteDirectory(tmpDir); Workbook wb = Workbook.createWorkbook(os, settings);
public void write() throws IOException, WriteException { File file = new File("file_location"); WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook wb= Workbook.createWorkbook(file, wbSettings); wb.createSheet("My Spreadsheet", 0); WritableSheet excel = wb.getSheet(0); createLabel(excel); createContent(excel); wb.write(); wb.close(); }
public void write() throws IOException, WriteException { File file = new File(inputFile); WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook = Workbook.createWorkbook(file, wbSettings); workbook.createSheet("Report", 0); WritableSheet excelSheet = workbook.getSheet(0); createLabel(excelSheet); createContent(excelSheet); workbook.write(); workbook.close(); }