jxl.Workbook.createWorkbook()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(910)

本文整理了Java中jxl.Workbook.createWorkbook()方法的一些代码示例,展示了Workbook.createWorkbook()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Workbook.createWorkbook()方法的具体详情如下:
包路径:jxl.Workbook
类名称:Workbook
方法名:createWorkbook

Workbook.createWorkbook介绍

[英]Creates a writable workbook with the given file name
[中]使用给定的文件名创建可写工作簿

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

if ( meta.isAppend() && targetFile.exists() ) {
 Workbook targetFileWorkbook = Workbook.getWorkbook( targetFile );
 data.workbook = Workbook.createWorkbook( targetFile, targetFileWorkbook );
 data.workbook = Workbook.createWorkbook( data.outputStream, data.ws );
  data.workbook = Workbook.createWorkbook( targetFile, targetFileWorkbook );
 } else {
  data.outputStream = KettleVFS.getOutputStream( data.file, false );
  data.workbook = Workbook.createWorkbook( data.outputStream, templateWorkbook );

代码示例来源:origin: x-ream/x7

workbook = Workbook.createWorkbook(file);
WritableSheet sheet = workbook.createSheet(clz.getSimpleName(), 0);
int r = 0, c = 0;

代码示例来源:origin: x-ream/x7

workbook = Workbook.createWorkbook(file);
WritableSheet sheet = workbook.createSheet(clz.getSimpleName(), 0);
int r = 0, c = 0;

代码示例来源:origin: Impetus/Kundera

/**
 * 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();
}

代码示例来源:origin: bill1012/AdminEAP

WritableWorkbook workbook = Workbook.createWorkbook(fout);
for (int qindex = 0; qindex < queryConditions.size(); qindex++) {
  QueryCondition queryCondition = queryConditions.get(qindex);

代码示例来源:origin: davidpelfree/sjxlsx

public void open() {
  try {
    if (file != null) {
      workbook = Workbook.createWorkbook(file);
    } else if (output != null) {
      workbook = Workbook.createWorkbook(output);
    } else {
      throw new IllegalStateException("no output specified");
    }
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: zhouzhuo810/ZzExcelCreator

@Override
public ZzExcelCreator createExcel(String pathDir, String name) throws IOException {
  File dir = new File(pathDir);
  if (!dir.exists())
    dir.mkdirs();
  writableWorkbook = Workbook.createWorkbook(new File(pathDir + File.separator + name + ".xls"));
  return this;
}

代码示例来源:origin: zhouzhuo810/ZzExcelCreator

@Override
public ZzExcelCreator openExcel(File file) throws IOException, BiffException {
  FileInputStream fis = new FileInputStream(file);
  Workbook wb = Workbook.getWorkbook(fis);
  writableWorkbook = Workbook.createWorkbook(file, wb);
  return this;
}

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

/**
 * 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());
}

代码示例来源:origin: com.hynnet/jxl

/**
 * 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());
}

代码示例来源:origin: com.hynnet/jxl

/**
 * Creates a writable workbook.  When the workbook is closed,
 * it will be streamed directly to the output stream.  In this
 * manner, a generated excel spreadsheet can be passed from
 * a servlet to the browser over HTTP
 *
 * @param os the output stream
 * @return the writable workbook
 * @exception IOException
 */
public static WritableWorkbook createWorkbook(OutputStream os)
 throws IOException
{
 return createWorkbook(os, new WorkbookSettings());
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

private WritableWorkbook createWorkbook(File workbookFile)
{
 WritableWorkbook writableWorkBook = null;
 try
 {
   writableWorkBook = Workbook.createWorkbook(workbookFile);
 }
 catch (IOException ex)
 {
   PrintTools.error(this, "Failed to open Excel workbook. " + workbookFile);
 }
 return writableWorkBook;
}

代码示例来源:origin: net.thucydides/thucydides-core

private WritableWorkbook openExistingSpreadsheet() throws BiffException, IOException {
  return Workbook.createWorkbook(outputFile, Workbook.getWorkbook(outputFile));
}

代码示例来源:origin: net.serenity-bdd/core

private WritableWorkbook openExistingSpreadsheet() throws BiffException, IOException {
  return Workbook.createWorkbook(outputFile, Workbook.getWorkbook(outputFile));
}

代码示例来源:origin: net.serenity-bdd/serenity-model

private WritableWorkbook openExistingSpreadsheet() throws BiffException, IOException {
  return Workbook.createWorkbook(outputFile, Workbook.getWorkbook(outputFile));
}

代码示例来源:origin: com.hynnet/jxl

/**
 * Creates a writable workbook as a copy of
 * the workbook passed in.  Once created, the contents of the writable
 * workbook may be modified
 *
 * @param os the stream to write to
 * @param in the workbook to copy
 * @return a writable workbook
 * @exception IOException
 */
public static WritableWorkbook createWorkbook(OutputStream os,
                       Workbook in)
 throws IOException
{
 return createWorkbook(os, in, ((WorkbookParser) in).getSettings());
}

代码示例来源:origin: jasperreports/jasperreports

protected void openWorkbook(OutputStream os) throws JRException
{
  try
  {
    workbook = Workbook.createWorkbook(os);
  }
  catch (IOException e)
  {
    throw new JRException("Error generating XLS report : " + jasperPrint.getName(), e);
  }
}

代码示例来源:origin: dhis2/dhis2-core

/**
   * 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 );
  }
}

代码示例来源:origin: org.icefaces/icefaces-compat

public ExcelOutputHandler(String path, FacesContext fc, String title) {
  super(path);
  try{
    WorkbookSettings settings = new WorkbookSettings();
    settings.setLocale(fc.getViewRoot().getLocale());
    workbook = Workbook.createWorkbook(super.getFile());
    sheet = workbook.createSheet(title, 0);
    
    this.mimeType = "application/vnd.ms-excel";
  }
  catch(IOException ioe){
    ioe.printStackTrace();
  }
  
}

代码示例来源:origin: org.jxls/jxls-jexcel

public static JexcelTransformer createTransformer(InputStream is, OutputStream os) throws IOException, BiffException {
  Workbook workbook = Workbook.getWorkbook(is);
  WritableWorkbook writableWorkbook = Workbook.createWorkbook(os, workbook);
  JexcelTransformer transformer = new JexcelTransformer(workbook, writableWorkbook);
  transformer.readCellData();
  return transformer;
}

相关文章