You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2018/02/04 16:38:40 UTC
[Bug 62075] New: XSSFCellStyle.BORDER_xxx not working
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: si3012@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-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 62075] XSSFCellStyle.BORDER_xxx not working
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62075
--- Comment #1 from Alain Fagot Bearez <Al...@cua.li> ---
The tutorial author should have taken the time to check the code is effectively
compiling. This leaves serious doubts about the quality of the rest of the
tutorial...
The following line
style.setBorderBottom(XSSFCellStyle.BORDER_THIN);
should have been
style.setBorderBottom(CellStyle.BORDER_THIN);
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 62075] XSSFCellStyle.BORDER_xxx not working
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62075
Javen O'Neal <on...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #2 from Javen O'Neal <on...@apache.org> ---
*** This bug has been marked as a duplicate of bug 61898 ***
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 62075] XSSFCellStyle.BORDER_xxx not working
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62075
si3012 <si...@hotmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |APIBug
OS| |All
CC| |si3012@hotmail.com
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 62075] XSSFCellStyle.BORDER_xxx not working
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62075
--- Comment #3 from Javen O'Neal <on...@apache.org> ---
This was fixed in the Spreadsheet Quick Guide 8 weeks ago (13 Dec 2017) [1] and
published 6 weeks ago (28 Dec 2017) [2]
[1] https://svn.apache.org/viewvc?view=revision&revision=1818054
[2] https://svn.apache.org/viewvc?view=revision&revision=1819416
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org