Bug 46714

Summary: method 'setRowSumsBelow(false)' doesn't work fine
Product: POI Reporter: Meng XiaoLong <mxlong.nj>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: ak.apache, mxlong.nj
Priority: P2    
Version: 3.0-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: the result iamge
the result image
the wanted iamge

Description Meng XiaoLong 2009-02-15 01:13:09 UTC
Created attachment 23257 [details]
the result iamge

Hello

I use POI 3.0 to create a Excel file with outline. And I use the method
"setRowSumsBelow"  to put detail below row summaries.
But when I open my file in MS EXCEL 2000 or Open Office, the row summaries
appear below detail in the outline  even if I put true or false to the
method.
I hope you understand my problem.

------------------start------------------
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("sheet1");
HSSFRow row;
HSSFCell cell;

sheet.setRowSumsBelow(false);

row = sheet.createRow(0);
cell = row.createCell(0);
cell.setCellValue("group");

for(int i=1;i<9;i++){
  row = sheet.createRow(i);
  cell = row.createCell(0);
  cell.setCellValue("value"+i);
}

sheet.groupRow(1, 8);

try {
  FileOutputStream fs = new FileOutputStream("./test.xls");
  workbook.write(fs);
  fs.close();
} catch (IOException e) {
  e.printStackTrace();
}
------------------end------------------
result image is as 'result.bmp', but the wanted result is as 'wanted.bmp'.
atattched files: 'result.bmp' and 'wanted.bmp'.

if I want to get the result as 'wanted.bmp' image, how to code?
Comment 1 Meng XiaoLong 2009-02-15 01:14:32 UTC
Created attachment 23258 [details]
the result image
Comment 2 Meng XiaoLong 2009-02-15 01:15:29 UTC
Created attachment 23259 [details]
the wanted iamge
Comment 3 Adam 2009-02-27 03:07:26 UTC
I think this is a duplicate of https://issues.apache.org/bugzilla/show_bug.cgi?id=30714

Try calling sheet.setAlternativeExpression(false); instead until it is fixed properly
Comment 4 Yegor Kozlov 2009-04-18 02:12:05 UTC
Fixed in r766273

I changed sheet.setRowSumsBelow to propagate the boolean flag to sheet.setAlternativeExpression. These two methods work in conjunction. 

Regards,
Yegor