Package jxl

Examples of jxl.WorkbookSettings


public class ExcelService {
    String[] abjadColumn = new String[]{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
    Logger logger = LoggerFactory.getLogger(ExcelService.class);

    public ByteArrayOutputStream createUserActivity(String patternFilePath, List<UserActivity> acitivities) {
        WorkbookSettings wb = new WorkbookSettings();
        wb.setLocale(new Locale("en", "US"));
        ByteArrayOutputStream boas = new ByteArrayOutputStream();
        Workbook wr = null;
        Map<String, UserUser> m = new HashMap<String, UserUser>();
        try {
            wr = Workbook.getWorkbook(new File(patternFilePath), wb);
View Full Code Here


    return (null == this.template) ? null : this.template.findCellByName( _styleName );
  }

  private WritableWorkbook createWorkbook() throws IOException
  {
    final WorkbookSettings xset = new WorkbookSettings();
    xset.setLocale( Locale.ENGLISH );
    if (null == this.template) {
      return Workbook.createWorkbook( this.outputStream, xset );
    }
    else {
      final WritableWorkbook xwb = Workbook.createWorkbook( this.outputStream, this.template, xset );
View Full Code Here


  public Spreadsheet loadFrom( String _originalFileName, InputStream _stream ) throws IOException,
      SpreadsheetException
  {
    final WorkbookSettings xlsSettings = new WorkbookSettings();
    xlsSettings.setLocale( Locale.ENGLISH );
    xlsSettings.setExcelDisplayLanguage( "EN" );
    xlsSettings.setExcelRegionalSettings( "EN" );
    xlsSettings.setEncoding( "ISO-8859-1" );
    xlsSettings.setAutoFilterDisabled( true );
    xlsSettings.setCellValidationDisabled( true );
    xlsSettings.setDrawingsDisabled( true );
    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 );
View Full Code Here

        this._useFirstSheet = true;
    }

    public void parseFile(InputStream inStream) {
        try {
            WorkbookSettings ws = new WorkbookSettings();
            Workbook workbook = Workbook.getWorkbook( inStream, ws);

            if ( _useFirstSheet ) {
                Sheet sheet = workbook.getSheet( 0 );
                processSheet( sheet,
View Full Code Here

   {
      if (log.isTraceEnabled())
      {
         log.trace("Creating workbook settings from #0", uiWorkbook);
      }
      WorkbookSettings workbookSettings = new WorkbookSettings();
      if (uiWorkbook.getArrayGrowSize() != null)
      {
         workbookSettings.setArrayGrowSize(uiWorkbook.getArrayGrowSize());
      }
      if (uiWorkbook.getAutoFilterDisabled() != null)
      {
         workbookSettings.setAutoFilterDisabled(uiWorkbook.getAutoFilterDisabled());
      }
      if (uiWorkbook.getAutoFilterDisabled() != null)
      {
         workbookSettings.setCellValidationDisabled(uiWorkbook.getAutoFilterDisabled());
      }
      if (uiWorkbook.getCharacterSet() != null)
      {
         workbookSettings.setCharacterSet(uiWorkbook.getCharacterSet());
      }
      if (uiWorkbook.getDrawingsDisabled() != null)
      {
         workbookSettings.setDrawingsDisabled(uiWorkbook.getDrawingsDisabled());
      }
      if (uiWorkbook.getEncoding() != null)
      {
         workbookSettings.setEncoding(uiWorkbook.getEncoding());
      }
      if (uiWorkbook.getExcelDisplayLanguage() != null)
      {
         workbookSettings.setExcelDisplayLanguage(uiWorkbook.getExcelDisplayLanguage());
      }
      if (uiWorkbook.getExcelRegionalSettings() != null)
      {
         workbookSettings.setExcelRegionalSettings(uiWorkbook.getExcelRegionalSettings());
      }
      if (uiWorkbook.getFormulaAdjust() != null)
      {
         workbookSettings.setFormulaAdjust(uiWorkbook.getFormulaAdjust());
      }
      if (uiWorkbook.getGcDisabled() != null)
      {
         workbookSettings.setGCDisabled(uiWorkbook.getGcDisabled());
      }
      if (uiWorkbook.getIgnoreBlanks() != null)
      {
         workbookSettings.setIgnoreBlanks(uiWorkbook.getIgnoreBlanks());
      }
      if (uiWorkbook.getLocale() != null)
      {
         workbookSettings.setLocale(new Locale(uiWorkbook.getLocale()));
      }
      if (uiWorkbook.getMergedCellCheckingDisabled() != null)
      {
         workbookSettings.setMergedCellChecking(uiWorkbook.getMergedCellCheckingDisabled());
      }
      if (uiWorkbook.getNamesDisabled() != null)
      {
         workbookSettings.setNamesDisabled(uiWorkbook.getNamesDisabled());
      }
      if (uiWorkbook.getPropertySets() != null)
      {
         workbookSettings.setPropertySets(uiWorkbook.getPropertySets());
      }
      if (uiWorkbook.getRationalization() != null)
      {
         workbookSettings.setRationalization(uiWorkbook.getRationalization());
      }
      if (uiWorkbook.getSupressWarnings() != null)
      {
         workbookSettings.setSuppressWarnings(uiWorkbook.getSupressWarnings());
      }
      if (uiWorkbook.getTemporaryFileDuringWriteDirectory() != null)
      {
         workbookSettings.setTemporaryFileDuringWriteDirectory(new File(uiWorkbook.getTemporaryFileDuringWriteDirectory()));
      }
      if (uiWorkbook.getUseTemporaryFileDuringWrite() != null)
      {
         workbookSettings.setUseTemporaryFileDuringWrite(uiWorkbook.getUseTemporaryFileDuringWrite());
      }
      return workbookSettings;
   }
View Full Code Here

            } catch (Exception e) {
                throw new ExcelWorkbookException(
                        "Could not handle template URI", e);
            }
        }
        WorkbookSettings workbookSettings = null;
        if (uiWorkbook.hasSettings()) {
            workbookSettings = jxlHelper.createWorkbookSettings(uiWorkbook);
        }
        if (log.isDebugEnabled()) {
            log.debug("Creating workbook with creation type #0", uiWorkbook
View Full Code Here

    if (file == null)
      throw new TaskException(State.DONE_ERR, "Param by name 'file' isn't set");
    File x = new File(file);
    if (!x.exists())
      throw new TaskException(State.DONE_ERR, "There is no file by name "+ file);
    ws = new WorkbookSettings();
    ws.setLocale(new Locale(language, country));

    workbook = null;
    try {
      workbook = Workbook.getWorkbook(x, ws);
View Full Code Here

    @Override
    protected Workbook getTemplateSource(String url, HttpServletRequest request) throws Exception {
      Workbook workbook = super.getTemplateSource(url, request);
      Field field = WorkbookParser.class.getDeclaredField("settings");
      field.setAccessible(true);
      WorkbookSettings settings = (WorkbookSettings) ReflectionUtils.getField(field, workbook);
      settings.setWriteAccess(null);
      return workbook;
    }
View Full Code Here

   {
      if (log.isTraceEnabled())
      {
         log.trace("Creating workbook settings from #0", uiWorkbook);
      }
      WorkbookSettings workbookSettings = new WorkbookSettings();
      if (uiWorkbook.getArrayGrowSize() != null)
      {
         workbookSettings.setArrayGrowSize(uiWorkbook.getArrayGrowSize());
      }
      if (uiWorkbook.getAutoFilterDisabled() != null)
      {
         workbookSettings.setAutoFilterDisabled(uiWorkbook.getAutoFilterDisabled());
      }
      if (uiWorkbook.getAutoFilterDisabled() != null)
      {
         workbookSettings.setCellValidationDisabled(uiWorkbook.getAutoFilterDisabled());
      }
      if (uiWorkbook.getCharacterSet() != null)
      {
         workbookSettings.setCharacterSet(uiWorkbook.getCharacterSet());
      }
      if (uiWorkbook.getDrawingsDisabled() != null)
      {
         workbookSettings.setDrawingsDisabled(uiWorkbook.getDrawingsDisabled());
      }
      if (uiWorkbook.getEncoding() != null)
      {
         workbookSettings.setEncoding(uiWorkbook.getEncoding());
      }
      if (uiWorkbook.getExcelDisplayLanguage() != null)
      {
         workbookSettings.setExcelDisplayLanguage(uiWorkbook.getExcelDisplayLanguage());
      }
      if (uiWorkbook.getExcelRegionalSettings() != null)
      {
         workbookSettings.setExcelRegionalSettings(uiWorkbook.getExcelRegionalSettings());
      }
      if (uiWorkbook.getFormulaAdjust() != null)
      {
         workbookSettings.setFormulaAdjust(uiWorkbook.getFormulaAdjust());
      }
      if (uiWorkbook.getGcDisabled() != null)
      {
         workbookSettings.setGCDisabled(uiWorkbook.getGcDisabled());
      }
      if (uiWorkbook.getIgnoreBlanks() != null)
      {
         workbookSettings.setIgnoreBlanks(uiWorkbook.getIgnoreBlanks());
      }
      if (uiWorkbook.getLocale() != null)
      {
         workbookSettings.setLocale(new Locale(uiWorkbook.getLocale()));
      }
      if (uiWorkbook.getMergedCellCheckingDisabled() != null)
      {
         workbookSettings.setMergedCellChecking(uiWorkbook.getMergedCellCheckingDisabled());
      }
      if (uiWorkbook.getNamesDisabled() != null)
      {
         workbookSettings.setNamesDisabled(uiWorkbook.getNamesDisabled());
      }
      if (uiWorkbook.getPropertySets() != null)
      {
         workbookSettings.setPropertySets(uiWorkbook.getPropertySets());
      }
      if (uiWorkbook.getRationalization() != null)
      {
         workbookSettings.setRationalization(uiWorkbook.getRationalization());
      }
      if (uiWorkbook.getSupressWarnings() != null)
      {
         workbookSettings.setSuppressWarnings(uiWorkbook.getSupressWarnings());
      }
      if (uiWorkbook.getTemporaryFileDuringWriteDirectory() != null)
      {
         workbookSettings.setTemporaryFileDuringWriteDirectory(new File(uiWorkbook.getTemporaryFileDuringWriteDirectory()));
      }
      if (uiWorkbook.getUseTemporaryFileDuringWrite() != null)
      {
         workbookSettings.setUseTemporaryFileDuringWrite(uiWorkbook.getUseTemporaryFileDuringWrite());
      }
      return workbookSettings;
   }
View Full Code Here

            } catch (Exception e) {
                throw new ExcelWorkbookException(
                        "Could not handle template URI", e);
            }
        }
        WorkbookSettings workbookSettings = null;
        if (uiWorkbook.hasSettings()) {
            workbookSettings = jxlHelper.createWorkbookSettings(uiWorkbook);
        }
        if (log.isDebugEnabled()) {
            log.debug("Creating workbook with creation type #0", uiWorkbook
View Full Code Here

TOP

Related Classes of jxl.WorkbookSettings

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.