All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.afu.utils.excel.ExcelWriter Maven / Gradle / Ivy

There is a newer version: 0.0.55-RELEASE
Show newest version
package io.afu.utils.excel;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.File;
import java.io.FileOutputStream;
import java.util.List;

public class ExcelWriter {

    public static void WriteExcel(List> linesToWrite, String savePath) {
        try {
            File file =  new File(savePath);
            FileOutputStream fileOutputStream = new FileOutputStream(file);
            Workbook workbook = new XSSFWorkbook();
            Sheet sheet = workbook.createSheet();
            for (int i = 0;i line = linesToWrite.get(i);
                for (int j = 0;j




© 2015 - 2024 Weber Informatics LLC | Privacy Policy