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

2006-06-14 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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


[EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]




-- 
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: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



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

2006-06-14 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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 [EMAIL PROTECTED]  2006-06-14 21:03 ---
I can confirm that this happens in the 2.5.1 release.

Here's a workaround that I use for the case where you want to put the last 
sheet in the first position:

for(int i = workbook.getNumberOfSheets() - 2; i >= 0 ; --i)
{
String sheetName = workbook.getSheetName(i);
workbook.cloneSheet(i);
workbook.removeSheetAt(i);
int lastSheet = workbook.getNumberOfSheets() - 1;
workbook.setSheetName(lastSheet, sheetName);

}

It's probably not too hard to generalize this for an abitrary position.

-- 
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: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



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

2006-08-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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 [EMAIL PROTECTED]  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: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



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

2006-08-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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


[EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]




-- 
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: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/



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

2007-03-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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


[EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]




--- Additional Comments From [EMAIL PROTECTED]  2007-03-27 12:44 ---
Here's a better workaround for using setSheetOrder() without using cloneSheet() 
method. The current open-source version will not 

support sheet cloning if the sheet has any embedded images or objects. As 
you've probably found out, setSheetOrder() only swaps 

the actual sheet content -- not the sheet's name. So you'll need to manually 
set that on your own.

As regards to the contents not swapping properly, try not to think about it 
as 'sheet 3 BEFORE sheet 1', but rather the opposite 

direction. So if you write the code as:

   workbook.setSheetName(sheetNameWhereIndexIsZero, 3); //this will work.

Anyways, here's my arbitrary positioned workaround:

//sheetName buffer.
int intTotalSheet = workbbook.getNumberOfSheets();
String[] straSheetName = new String[intTotalSheet];

for (int b=0; bhttp://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: [EMAIL PROTECTED]
Mailing List:http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/