ASF Bugzilla – Attachment 34900 Details for
Bug 60959
Setting the cell to type numeric results in cell type blank
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
The java code which collects celltype from a cell and writes it to another cell. But the celltype NUMERIC is inherited as blank.
Bug.java (text/x-java), 1.18 KB, created by
Rishi Ranjan
on 2017-04-06 13:22:32 UTC
(
hide
)
Description:
The java code which collects celltype from a cell and writes it to another cell. But the celltype NUMERIC is inherited as blank.
Filename:
MIME Type:
Creator:
Rishi Ranjan
Created:
2017-04-06 13:22:32 UTC
Size:
1.18 KB
patch
obsolete
>import java.io.*; >import java.util.*; >import org.apache.poi.ss.usermodel.*; >import org.apache.poi.xssf.usermodel.*; > >public class Bug { > > /** > * @param args > * @throws IOException > */ > public static void main(String[] args) throws IOException { > > FileInputStream fis= new FileInputStream("abcs.xlsx"); > FileOutputStream fos = new FileOutputStream("Output.xlsx"); > > XSSFWorkbook xwb= new XSSFWorkbook(fis); > XSSFWorkbook xwb2= new XSSFWorkbook(); > > XSSFSheet sheet= xwb.getSheetAt(0); > XSSFSheet sheet2= xwb2.createSheet(); > > Iterator<Row> rite=sheet.rowIterator(); > > while(rite.hasNext()) > { > > Row row=(Row) rite.next(); > int rowi=row.getRowNum(); > Row row2= sheet2.createRow(rowi); > > Iterator<Cell> cite=row.cellIterator(); > > while(cite.hasNext()){ > Cell cell=(Cell) cite.next(); > int celli=cell.getColumnIndex(); > Cell cell2=row2.createCell(celli); > CellType addd=cell.getCellTypeEnum(); > System.out.print(addd+" "); > cell2.setCellType(addd); > > System.out.println(cell2.getCellTypeEnum()); > > celli++; > } > System.out.println(); > > rowi++; > > } > > xwb2.write(fos); > fis.close(); > fos.close(); > xwb2.close(); > xwb.close(); > > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 60959
: 34900 |
34901