You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2006/08/24 18:51:26 UTC

DO NOT REPLY [Bug 23951] - setSheetOrder(...) of HSSFWorkBook class doesn't set tab name correctly in Excel file

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=23951>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=23951





------- Additional Comments From adrianrm@web.de  2006-08-24 16:51 -------
I think the problem goes deeper. Here is an example error case:

I have a workbook with 6 sheets
1) Open the workbook
2) Call setSheetOrder(...) to move sheet 3 before sheet 1;
3) Save the file
4) Open the file
The result is that the name of the tabs hasn't changed, but the contents of the
tabs follow the order: 2,3,1,4,5,6.

I've tried to fix it, but don't know much about the project, so it didn't make
(apparently)anything. I changed the setSheetOrder method in class HSSFWorkbook:

    public void setSheetOrder(String sheetname, int pos ) {
        workbook.setSheetOrder(sheetname, pos);
    	int sheetNumber = getSheetIndex(sheetname);
    	//remove the sheet that needs to be reordered and place it in the spot we want
    	sheets.add(pos, sheets.remove(sheetNumber));	        
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/