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
4119cfbcc4
commit
36cd7fe4fe
@ -33,6 +33,7 @@
|
|||||||
<li><link href="#PrintArea">Set print area for a sheet.</link></li>
|
<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="#FooterPageNumbers">Set page numbers on the footer of a sheet.</link></li>
|
||||||
<li><link href="#ShiftRows">Shift rows.</link></li>
|
<li><link href="#ShiftRows">Shift rows.</link></li>
|
||||||
|
<li><link href="#SelectSheet">Set a sheet as selected.</link></li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
<section title="Features">
|
<section title="Features">
|
||||||
@ -459,6 +460,21 @@
|
|||||||
// Shift rows 6 - 11 on the spreadsheet to the top (rows 0 - 5)
|
// Shift rows 6 - 11 on the spreadsheet to the top (rows 0 - 5)
|
||||||
sheet.shiftRows(5, 10, -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");
|
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
|
||||||
wb.write(fileOut);
|
wb.write(fileOut);
|
||||||
fileOut.close();
|
fileOut.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user