https://bz.apache.org/bugzilla/show_bug.cgi?id=62075

            Bug ID: 62075
           Summary: XSSFCellStyle.BORDER_xxx not working
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: si3...@hotmail.com
  Target Milestone: ---

Created attachment 35714
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35714&action=edit
the code in Netbeans

HI, I am new in Java and I am using POI for the first time I get Problem with
XSSFCellStyle.BORDER_XXX wich give me in The editor (Netbeans) cannot found the
Symbol
please check the Attachement for more details.
PS : I am usisng tutorial from Busy' Developer's Guide to HSSF and XSSF
Features

////////////////the Code/////////////////////////
package ExcelTo;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.sl.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import static org.apache.poi.ss.usermodel.FillPatternType.BIG_SPOTS;
import static org.apache.poi.ss.usermodel.FillPatternType.SOLID_FOREGROUND;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.WorkbookUtil;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder;
/**
 *
 * @author Jabida
 */
public class Depart {
    public static void main(String[] args) throws FileNotFoundException,
IOException{
    Workbook wb = new XSSFWorkbook();
    org.apache.poi.ss.usermodel.Sheet sheet = wb.createSheet("Depart congé");
    // Create a row and put some cells in it. Rows are 0 based.
    Row row = sheet.createRow(1);
    // Create a cell and put a value in it.
    Cell cell = row.createCell(1);
    cell.setCellValue(4);
    // Style the cell with borders all around.
    CellStyle style = wb.createCellStyle();
    style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
    style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
    style.setBorderLeft(CellStyle.BORDER_THIN);
    style.setLeftBorderColor(IndexedColors.GREEN.getIndex());
    style.setBorderRight(CellStyle.BORDER_THIN);
    style.setRightBorderColor(IndexedColors.BLUE.getIndex());
    style.setBorderTop(CellStyle.BORDER_MEDIUM_DASHED);
    style.setTopBorderColor(IndexedColors.BLACK.getIndex());
    cell.setCellStyle(style);
        try ( // Write the output to a file
                FileOutputStream fileOut = new
FileOutputStream("workbook.xlsx")) {
            wb.write(fileOut);
            fileOut.close();
        }

    }

}

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to