Update to Quick Guide to better represent what the Fit To example is for.
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353407 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
242817389a
commit
ea54575258
@ -31,7 +31,7 @@
|
||||
<li><link href="#ReadWriteWorkbook">Reading and writing</link></li>
|
||||
<li><link href="#NewLinesInCells">Use newlines in cells.</link></li>
|
||||
<li><link href="#DataFormats">Create user defined data formats.</link></li>
|
||||
<li><link href="#PrintArea">Fit sheet to one page</link></li>
|
||||
<li><link href="#FitTo">Fit Sheet to One Page</link></li>
|
||||
<li><link href="#PrintArea2">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>
|
||||
@ -420,14 +420,14 @@
|
||||
fileOut.close();
|
||||
</source>
|
||||
</section>
|
||||
<anchor id="PrintArea"/>
|
||||
<section><title>Set Print Area to One Page</title>
|
||||
<anchor id="FitTo"/>
|
||||
<section><title>Fit Sheet to One Page</title>
|
||||
<source>
|
||||
HSSFWorkbook wb = new HSSFWorkbook();
|
||||
HSSFSheet sheet = wb.createSheet("format sheet");
|
||||
HSSFPrintSetup ps = sheet.getPrintSetup()
|
||||
HSSFPrintSetup ps = sheet.getPrintSetup();
|
||||
|
||||
sheet.setAutobreaks(true)
|
||||
sheet.setAutobreaks(true);
|
||||
|
||||
ps.setFitHeight((short)1);
|
||||
ps.setFitWidth((short)1);
|
||||
|
@ -175,5 +175,18 @@ public class TestSheetShiftRows extends TestCase {
|
||||
s.createRow(3).createCell((short)0).setCellValue("TEST2");
|
||||
s.shiftRows(0,4,1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests when shifting the first row.
|
||||
*
|
||||
* @author Toshiaki Kamoshida (kamoshida.toshiaki at future dot co dot jp)
|
||||
*/
|
||||
public void testShiftRow0(){
|
||||
HSSFWorkbook b = new HSSFWorkbook();
|
||||
HSSFSheet s = b.createSheet();
|
||||
s.createRow(0).createCell((short)0).setCellValue("TEST1");
|
||||
s.createRow(3).createCell((short)0).setCellValue("TEST2");
|
||||
s.shiftRows(0,4,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user