PDA

View Full Version : How to write merged cells?



venkateshv76
10-22-2010, 04:28 PM
Tom,

I looked up the POI website for examples of writing data onto merged cells. This is what I read of their examples:

Workbook wb = new HSSFWorkbook();
Sheet sheet = wb.createSheet("new sheet");

Row row = sheet.createRow((short) 1);
Cell cell = row.createCell((short) 1);
cell.setCellValue("This is a test of merging");

sheet.addMergedRegion(new CellRangeAddress(
1, //first row (0-based)
1, //last row (0-based)
1, //first column (0-based)
2 //last column (0-based)
));

// Write the output to a file

Do you have any methods / examples for addMergedRegion?

Regards,
Venky

venkateshv76
10-26-2010, 11:49 AM
Tom,

No worries. I got that sorted. I was able to get ILE RPG implementation for methods new_Region and addMergedRegion.

Regards,
Venky