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 2013/04/26 09:00:32 UTC
[Bug 54894] New: Cell gets corrupted after calling cloneStyleFrom
and setBorderBottom
https://issues.apache.org/bugzilla/show_bug.cgi?id=54894
Bug ID: 54894
Summary: Cell gets corrupted after calling cloneStyleFrom and
setBorderBottom
Product: POI
Version: 3.9
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
Assignee: dev@poi.apache.org
Reporter: kasala.asha@gmail.com
Classification: Unclassified
In the code below the cell gets corrupted when we call setCellStyle on it after
calling cloneStyleFrom and setBorderBottom.In the generated file right click on
the cell to which the style was applied to notice that the "Format cells "
dialog doesnot come up.
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* Demonstrates how to create borders around cells.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class Borders
{
public static void main(String[] args)
throws IOException
{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
// Create a row and put some cells in it. Rows are 0 based.
HSSFRow row = sheet.createRow((short) 1);
// Create a cell and put a value in it.
HSSFCell cell = row.createCell((short) 1);
cell.setCellValue(4);
CellStyle def = cell.getCellStyle();
// Style the cell with borders all around.
HSSFCellStyle style = wb.createCellStyle();
style.cloneStyleFrom(def);
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
cell.setCellStyle(style);
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
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 54894] Cell gets corrupted after calling cloneStyleFrom and
setBorderBottom
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54894
--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
Still happens in current version of Excel, does not happen in OpenOffice,
BiffViewer shows the following diff:
---
+++
@@ -1246,28 +1246,28 @@
.alignmentoptions= 20
.alignment = 0
.wraptext = false
.valignment= 2
.justlast = 0
.rotation = 0
- .indentionoptions= 0
+ .indentionoptions= 2000
.indent = 0
.shrinktoft= false
.mergecells= false
.readngordr= 0
.formatflag= false
.fontflag = false
.prntalgnmt= false
- .borderflag= false
+ .borderflag= true
.paternflag= false
.celloption= false
- .borderoptns = 0
+ .borderoptns = 1000
.lftln = 0
.rgtln = 0
.topln = 0
- .btmln = 0
+ .btmln = 1
.paleteoptns = 0
.leftborder= 0
.rghtborder= 0
.diag = 0
.paleteoptn2 = 0
.topborder = 0
@@ -1542,13 +1542,13 @@
[/ROW]
Offset=0x00000651(1617) recno=92 sid=0x0203 size=0x000E(14)
[NUMBER]
.row = 0x0001
.col = 0x0001
- .xfindex= 0x000F
+ .xfindex= 0x0015
.value= 4
[/NUMBER]
Offset=0x00000663(1635) recno=93 sid=0x00D7 size=0x0006(6)
[DBCELL]
.rowoffset = 0x00000026
--
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 54894] Cell gets corrupted after calling cloneStyleFrom and
setBorderBottom
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54894
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WORKSFORME
--- Comment #2 from Dominik Stadler <do...@gmx.at> ---
I could not reproduce this with latest POI-trunk and Excel in Office 365, so I
assume it is either fixed in POI now or it was a bug in Excel itself which is
fixed there in later versions of Excel.
--
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 54894] Cell gets corrupted after calling cloneStyleFrom and
setBorderBottom
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54894
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dominik.stadler@gmx.at
--
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