Search in sources :

Example 56 with XSSFSheet

use of org.apache.poi.xssf.usermodel.XSSFSheet in project bamboobsc by billchen198318.

the class KpiPeriodTrendsExcelCommand method createExcel.

private String createExcel(Context context) throws Exception {
    String fileName = SimpleUtils.getUUIDStr() + ".xlsx";
    String fileFullPath = Constants.getWorkTmpDir() + "/" + fileName;
    XSSFWorkbook wb = new XSSFWorkbook();
    XSSFSheet sh = wb.createSheet();
    this.putTables(wb, sh, context);
    FileOutputStream out = new FileOutputStream(fileFullPath);
    wb.write(out);
    out.close();
    wb = null;
    File file = new File(fileFullPath);
    String oid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, file, "kpis-period-trends.xlsx");
    file = null;
    return oid;
}
Also used : XSSFSheet(org.apache.poi.xssf.usermodel.XSSFSheet) FileOutputStream(java.io.FileOutputStream) XSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook) File(java.io.File)

Example 57 with XSSFSheet

use of org.apache.poi.xssf.usermodel.XSSFSheet in project bamboobsc by billchen198318.

the class ObjectivesDashboardExcelCommand method createExcel.

private String createExcel(Context context) throws Exception {
    String fileName = SimpleUtils.getUUIDStr() + ".xlsx";
    String fileFullPath = Constants.getWorkTmpDir() + "/" + fileName;
    XSSFWorkbook wb = new XSSFWorkbook();
    XSSFSheet sh = wb.createSheet();
    this.putCharts(wb, sh, context);
    FileOutputStream out = new FileOutputStream(fileFullPath);
    wb.write(out);
    out.close();
    wb = null;
    File file = new File(fileFullPath);
    String oid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, file, "objectives-dashboard.xlsx");
    file = null;
    return oid;
}
Also used : XSSFSheet(org.apache.poi.xssf.usermodel.XSSFSheet) FileOutputStream(java.io.FileOutputStream) XSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook) File(java.io.File)

Example 58 with XSSFSheet

use of org.apache.poi.xssf.usermodel.XSSFSheet in project bamboobsc by billchen198318.

the class TimeSeriesAnalysisExcelCommand method createExcel.

private String createExcel(Context context) throws Exception {
    String fileName = SimpleUtils.getUUIDStr() + ".xlsx";
    String fileFullPath = Constants.getWorkTmpDir() + "/" + fileName;
    XSSFWorkbook wb = new XSSFWorkbook();
    XSSFSheet sh = wb.createSheet();
    this.putTables(wb, sh, context);
    FileOutputStream out = new FileOutputStream(fileFullPath);
    wb.write(out);
    out.close();
    wb = null;
    File file = new File(fileFullPath);
    String oid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, file, "forecast-analysis.xlsx");
    file = null;
    return oid;
}
Also used : XSSFSheet(org.apache.poi.xssf.usermodel.XSSFSheet) FileOutputStream(java.io.FileOutputStream) XSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook) File(java.io.File)

Example 59 with XSSFSheet

use of org.apache.poi.xssf.usermodel.XSSFSheet in project bamboobsc by billchen198318.

the class PerspectivesDashboardExcelCommand method createExcel.

private String createExcel(Context context) throws Exception {
    String fileName = SimpleUtils.getUUIDStr() + ".xlsx";
    String fileFullPath = Constants.getWorkTmpDir() + "/" + fileName;
    XSSFWorkbook wb = new XSSFWorkbook();
    XSSFSheet sh = wb.createSheet();
    this.putCharts(wb, sh, context);
    FileOutputStream out = new FileOutputStream(fileFullPath);
    wb.write(out);
    out.close();
    wb = null;
    File file = new File(fileFullPath);
    String oid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, file, "perspectives-dashboard.xlsx");
    file = null;
    return oid;
}
Also used : XSSFSheet(org.apache.poi.xssf.usermodel.XSSFSheet) FileOutputStream(java.io.FileOutputStream) XSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook) File(java.io.File)

Example 60 with XSSFSheet

use of org.apache.poi.xssf.usermodel.XSSFSheet in project chilo-producer by cccties.

the class AuthorReader method read.

public void read() {
    try {
        workBook = new XSSFWorkbook(new FileInputStream(filePath.toString()));
        Iterator<XSSFSheet> sheetIte = workBook.iterator();
        while (sheetIte.hasNext()) {
            Sheet sheet = sheetIte.next();
            Map<String, List<String>> map = readSheet(sheet);
            object.put(sheet.getSheetName(), map);
        }
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        try {
            workBook.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
Also used : XSSFSheet(org.apache.poi.xssf.usermodel.XSSFSheet) FileNotFoundException(java.io.FileNotFoundException) XSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook) ArrayList(java.util.ArrayList) List(java.util.List) IOException(java.io.IOException) Sheet(org.apache.poi.ss.usermodel.Sheet) XSSFSheet(org.apache.poi.xssf.usermodel.XSSFSheet) FileInputStream(java.io.FileInputStream)

Aggregations

XSSFSheet (org.apache.poi.xssf.usermodel.XSSFSheet)60 XSSFWorkbook (org.apache.poi.xssf.usermodel.XSSFWorkbook)44 FileOutputStream (java.io.FileOutputStream)22 Test (org.junit.Test)22 File (java.io.File)19 XSSFRow (org.apache.poi.xssf.usermodel.XSSFRow)16 XSSFCell (org.apache.poi.xssf.usermodel.XSSFCell)11 XSSFCellStyle (org.apache.poi.xssf.usermodel.XSSFCellStyle)8 Row (org.apache.poi.ss.usermodel.Row)6 Sheet (org.apache.poi.ss.usermodel.Sheet)6 CellReference (org.apache.poi.ss.util.CellReference)6 XSSFMap (org.apache.poi.xssf.usermodel.XSSFMap)6 OutputStreamWriter (java.io.OutputStreamWriter)5 XlsxWriterHelper (com.cubrid.common.ui.cubrid.table.control.XlsxWriterHelper)4 IOException (java.io.IOException)4 OutputStream (java.io.OutputStream)4 ArrayList (java.util.ArrayList)4 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)3 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)3 FileInputStream (java.io.FileInputStream)3