Bug 46714 - method 'setRowSumsBelow(false)' doesn't work fine
Summary: method 'setRowSumsBelow(false)' doesn't work fine
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-15 01:13 UTC by Meng XiaoLong
Modified: 2009-04-18 02:12 UTC (History)
2 users (show)



Attachments
the result iamge (6.83 KB, application/x-zip-compressed)
2009-02-15 01:13 UTC, Meng XiaoLong
Details
the result image (127.18 KB, image/bmp)
2009-02-15 01:14 UTC, Meng XiaoLong
Details
the wanted iamge (129.76 KB, image/bmp)
2009-02-15 01:15 UTC, Meng XiaoLong
Details

Note You need to log in before you can comment on or make changes to this bug.
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