use of org.apache.poi.hssf.record.WSBoolRecord in project poi by apache.
the class HSSFSheet method setRowSumsBelow.
/**
* set if row summaries appear below detail in the outline
*
* @param b below or not
*/
@Override
public void setRowSumsBelow(boolean b) {
WSBoolRecord record = (WSBoolRecord) _sheet.findFirstRecordBySid(WSBoolRecord.sid);
record.setRowSumsBelow(b);
//setAlternateExpression must be set in conjuction with setRowSumsBelow
record.setAlternateExpression(b);
}
use of org.apache.poi.hssf.record.WSBoolRecord in project poi by apache.
the class HSSFSheet method setDialog.
/**
* set whether sheet is a dialog sheet or not
*
* @param b isDialog or not
*/
public void setDialog(boolean b) {
WSBoolRecord record = (WSBoolRecord) _sheet.findFirstRecordBySid(WSBoolRecord.sid);
record.setDialog(b);
}
use of org.apache.poi.hssf.record.WSBoolRecord in project poi by apache.
the class HSSFSheet method setFitToPage.
/**
* fit to page option is on
*
* @param b fit or not
*/
@Override
public void setFitToPage(boolean b) {
WSBoolRecord record = (WSBoolRecord) _sheet.findFirstRecordBySid(WSBoolRecord.sid);
record.setFitToPage(b);
}
use of org.apache.poi.hssf.record.WSBoolRecord in project poi by apache.
the class HSSFSheet method setDisplayGuts.
/**
* set whether to display the guts or not
*
* @param b guts or no guts (or glory)
*/
@Override
public void setDisplayGuts(boolean b) {
WSBoolRecord record = (WSBoolRecord) _sheet.findFirstRecordBySid(WSBoolRecord.sid);
record.setDisplayGuts(b);
}
use of org.apache.poi.hssf.record.WSBoolRecord in project poi by apache.
the class TestHSSFSheet method wsBool.
/**
* Test WSBboolRecord fields get set in the user model.
*/
@Test
public void wsBool() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet s = wb.createSheet();
WSBoolRecord record = (WSBoolRecord) s.getSheet().findFirstRecordBySid(WSBoolRecord.sid);
// Check defaults
assertTrue(record.getAlternateExpression());
assertTrue(record.getAlternateFormula());
assertFalse(record.getAutobreaks());
assertFalse(record.getDialog());
assertFalse(record.getDisplayGuts());
assertTrue(record.getFitToPage());
assertFalse(record.getRowSumsBelow());
assertFalse(record.getRowSumsRight());
// Alter
s.setAlternativeExpression(false);
s.setAlternativeFormula(false);
s.setAutobreaks(true);
s.setDialog(true);
s.setDisplayGuts(true);
s.setFitToPage(false);
s.setRowSumsBelow(true);
s.setRowSumsRight(true);
// Check
//sheet.setRowSumsBelow alters this field too
assertTrue(record.getAlternateExpression());
assertFalse(record.getAlternateFormula());
assertTrue(record.getAutobreaks());
assertTrue(record.getDialog());
assertTrue(record.getDisplayGuts());
assertFalse(record.getFitToPage());
assertTrue(record.getRowSumsBelow());
assertTrue(record.getRowSumsRight());
assertTrue(s.getAlternateExpression());
assertFalse(s.getAlternateFormula());
assertTrue(s.getAutobreaks());
assertTrue(s.getDialog());
assertTrue(s.getDisplayGuts());
assertFalse(s.getFitToPage());
assertTrue(s.getRowSumsBelow());
assertTrue(s.getRowSumsRight());
wb.close();
}
Aggregations