Package org.formulacompiler.spreadsheet.internal.loader.builder

Examples of org.formulacompiler.spreadsheet.internal.loader.builder.SpreadsheetBuilder


    xlsSettings.setMergedCellChecking( false );
    xlsSettings.setPropertySets( false );
    xlsSettings.setSuppressWarnings( true );
    try {
      final jxl.Workbook xlsWorkbook = jxl.Workbook.getWorkbook( _stream, xlsSettings );
      final SpreadsheetBuilder spreadsheetBuilder = new SpreadsheetBuilder( ComputationMode.EXCEL );

      loadConfig( xlsWorkbook );

      for (final jxl.Sheet xlsSheet : xlsWorkbook.getSheets()) {
        final SheetBuilder sheetBuilder = spreadsheetBuilder.beginSheet( xlsSheet.getName() );
        loadRows( xlsSheet, sheetBuilder );
        sheetBuilder.endSheet();
      }

      final BaseSpreadsheet workbook = spreadsheetBuilder.getSpreadsheet();
      loadNames( xlsWorkbook, workbook );
      return workbook;
    }
    catch (jxl.read.biff.BiffException e) {
      throw new SpreadsheetException.LoadError( "Error parsing " + _originalFileName, e );
View Full Code Here


    throw new SpreadsheetException.LoadError( "<content.xml> is missing in <" + _originalFileName + ">" );
  }

  private Spreadsheet readContent( String _fileName, InputStream _inputStream ) throws SpreadsheetException
  {
    final SpreadsheetBuilder spreadsheetBuilder = new SpreadsheetBuilder( ComputationMode.OPEN_OFFICE_CALC );

    try {
      final SpreadsheetParser spreadsheetParser = new SpreadsheetParser( spreadsheetBuilder, this.config );
      final Parser parser = new Parser( Collections.singletonMap( XMLConstants.Office.SPREADSHEET, spreadsheetParser ) );
      parser.parse( _inputStream );
    }
    catch (XMLStreamException e) {
      final Throwable nestedException = e.getNestedException();
      if (nestedException != null) {
        e.initCause( nestedException );
      }
      throw new SpreadsheetException.LoadError( "Error loading " + _fileName, e );
    }

    return spreadsheetBuilder.getSpreadsheet();
  }
View Full Code Here

TOP

Related Classes of org.formulacompiler.spreadsheet.internal.loader.builder.SpreadsheetBuilder

Copyright © 2018 www.massapicom. 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.