Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Xssf Merging[POI]

 
Shuvradeep Sengupta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to work fine with xssf for a particular cell in terms of value addition , applying style sheet.

cs.setAlignment(cs.ALIGN_LEFT);
sheet.getRow(mainlastrow).createCell(1).setCellValue("FileStore ::"+RscBundle.getString(Code+"_"+cmdCount));
sheet.getRow(mainlastrow).getCell(1).setCellStyle(cs);

But i need to do this style sheet , put values part in terms of a xssf merged region :: CellRangeAddress(28,28,5,9)
XSSFWorkbook workbook1=new XSSFWorkbook(inputStream);
XSSFSheet sheet = workbook1.getSheetAt(1);
sheet.addMergedRegion(new CellRangeAddress(28,28,5,9));

Till the creation of this merged xssf region , it is working fine. What i am not getting how to put values and apply style sheet for the merged region.

Thanks in advance.
 
Olivier Rihoux
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
simply you have to create the Row and the left-upper cell in your range (if not existing yet), otherwise, just assign value to that cell :
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic