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 2003/05/20 09:17:20 UTC

DO NOT REPLY [Bug 17759] - [PATCH][RFE]Add a way to change the displayed sheet in usermodel API

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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17759

[PATCH][RFE]Add a way to change the displayed sheet in usermodel API

kamoshida.toshiaki@future.co.jp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[RFE]Add a way to change the|[PATCH][RFE]Add a way to
                   |displayed sheet in usermodel|change the displayed sheet
                   |API                         |in usermodel API



------- Additional Comments From kamoshida.toshiaki@future.co.jp  2003-05-20 07:17 -------
Please apply the PATCH and execute it and check Test1.xls and Test2.xls with 
Excel Application.

import java.io.FileOutputStream;

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class Test {
	public static void main(String[] args) throws Exception{
		HSSFWorkbook book = new HSSFWorkbook();
		HSSFSheet s1 = book.createSheet("Test1");
		HSSFSheet s2 = book.createSheet("Test2");
		book.write(new FileOutputStream("Test1.xls"));
		s1.setSelected(false);
		s2.setSelected(true);
		book.setSelectedSheet("Test2");
		book.write(new FileOutputStream("Test2.xls"));
	}
}