mirror of https://github.com/apache/poi.git
Added quickguide to demonstrate how to set a sheet as selected in a workbook.
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352882 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
57a0266457
commit
c1f993afbf
|
@ -33,6 +33,7 @@
|
|||
<li><link href="#PrintArea">Set print area for a sheet.</link></li>
|
||||
<li><link href="#FooterPageNumbers">Set page numbers on the footer of a sheet.</link></li>
|
||||
<li><link href="#ShiftRows">Shift rows.</link></li>
|
||||
<li><link href="#SelectSheet">Set a sheet as selected.</link></li>
|
||||
</ul>
|
||||
</section>
|
||||
<section title="Features">
|
||||
|
@ -459,6 +460,21 @@
|
|||
// Shift rows 6 - 11 on the spreadsheet to the top (rows 0 - 5)
|
||||
sheet.shiftRows(5, 10, -5);
|
||||
|
||||
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
|
||||
wb.write(fileOut);
|
||||
fileOut.close();
|
||||
</source>
|
||||
</section>
|
||||
|
||||
<anchor id="SelectSheet"/>
|
||||
<section title="Set a sheet as selected">
|
||||
<source>
|
||||
HSSFWorkbook wb = new HSSFWorkbook();
|
||||
HSSFSheet sheet = wb.createSheet("row sheet");
|
||||
sheet.setSelected(true);
|
||||
|
||||
// Create various cells and rows for spreadsheet.
|
||||
|
||||
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
|
||||
wb.write(fileOut);
|
||||
fileOut.close();
|
||||
|
|
Loading…
Reference in New Issue