Examples of SXSSFWorkbook


Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

            throw new RuntimeException(e);
        }
        return result;
    }
    public SXSSFWorkbook createWorkbook(){
        return new SXSSFWorkbook();
    }
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

     */
    public static Workbook readWorkbook(ExcelDataContext dataContext) {
        Resource resource = dataContext.getResource();
        if (!resource.isExists()) {
            if (isXlsxFile(resource)) {
                return new SXSSFWorkbook(1000);
            } else {
                return new HSSFWorkbook();
            }
        }
        return readWorkbook(resource);
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

    Workbook retval = null;
   
    //
    if ( this.useXLSXFileFormat() )
    {
      retval = new SXSSFWorkbook();
    }
    else
    {
      retval = new HSSFWorkbook();
    }
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

            if (_workbook != null) {
                ExcelUtils.writeWorkbook(_dataContext, _workbook);
            }
            _workbook = ExcelUtils.readWorkbook(_dataContext);
            if (streamingAllowed && _workbook instanceof XSSFWorkbook) {
                _workbook = new SXSSFWorkbook((XSSFWorkbook) _workbook);
            }
        }
        return _workbook;
    }
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

    @Ignore("Shifting rows is not yet implemented in SXSSFSheet")
    @Test
    public void testBug53798XLSXStream() throws IOException {
        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53798_shiftNegative_TMPL.xlsx");
        File xlsOutput = TempFile.createTempFile("testBug53798", ".xlsx");
        bug53798Work(new SXSSFWorkbook(wb), xlsOutput);
    }
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

                if(wb instanceof XSSFWorkbook) {
                    newWB = new XSSFWorkbook(is);
                } else if(wb instanceof HSSFWorkbook) {
                    newWB = new HSSFWorkbook(is);
                } else if(wb instanceof SXSSFWorkbook) {
                    newWB = new SXSSFWorkbook(new XSSFWorkbook(is));
                } else {
                    throw new IllegalStateException("Unknown workbook: " + wb);
                }
                assertNotNull(newWB.getSheet("test"));
            } finally {
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

        // now write the file and read it back in
        XSSFWorkbook wbWritten = XSSFTestDataSamples.writeOutAndReadBack(wb);
        verifyBug54084Unicode(wbWritten);

        // finally also write it out via the streaming interface and verify that we still can read it back in
        Workbook wbStreamingWritten = SXSSFITestDataProvider.instance.writeOutAndReadBack(new SXSSFWorkbook(wb));
        verifyBug54084Unicode(wbStreamingWritten);
    }
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

  // Disabled because shift rows is not yet implemented for SXSSFWorkbook
  public void disabled_testBug53798XLSXStream() throws IOException {
      XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("53798_shiftNegative_TMPL.xlsx");
        File xlsOutput = TempFile.createTempFile("testBug53798", ".xlsx");
        bug53798Work(new SXSSFWorkbook(wb), xlsOutput);
  }
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

      if(wb instanceof XSSFWorkbook) {
        newWB = new XSSFWorkbook(is);
      } else if(wb instanceof HSSFWorkbook) {
        newWB = new HSSFWorkbook(is);
      } else if(wb instanceof SXSSFWorkbook) {
        newWB = new SXSSFWorkbook(new XSSFWorkbook(is));
      } else {
        throw new IllegalStateException("Unknown workbook: " + wb);
      }
      assertNotNull(newWB.getSheet("test"));
    } finally {
View Full Code Here

Examples of org.apache.poi.xssf.streaming.SXSSFWorkbook

            assertEquals("Did not match for sheet " + si, topRows[si], sh.getTopRow());
        }

        // for XSSF also test with SXSSF
        if(isXSSF) {
            Workbook swb = new SXSSFWorkbook((XSSFWorkbook) wb);
            for (int si = 0; si < swb.getNumberOfSheets(); si++) {
                Sheet sh = swb.getSheetAt(si);
                assertNotNull(sh.getSheetName());
                assertEquals("Did not match for sheet " + si, topRows[si], sh.getTopRow());
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.