use of org.apache.poi.hssf.record.HeaderRecord in project poi by apache.
the class HSSFHeader method setHeaderFooterText.
@Override
protected void setHeaderFooterText(String text) {
HeaderRecord hfr = _psb.getHeader();
if (hfr == null) {
hfr = new HeaderRecord(text);
_psb.setHeader(hfr);
} else {
hfr.setText(text);
}
}
use of org.apache.poi.hssf.record.HeaderRecord in project poi by apache.
the class HSSFChart method createBarChart.
/**
* Creates a bar chart. API needs some work. :)
* <p>
* NOTE: Does not yet work... checking it in just so others
* can take a look.
*/
public void createBarChart(HSSFWorkbook workbook, HSSFSheet parentSheet) {
List<Record> records = new ArrayList<Record>();
records.add(createMSDrawingObjectRecord());
records.add(createOBJRecord());
records.add(createBOFRecord());
records.add(new HeaderRecord(""));
records.add(new FooterRecord(""));
records.add(createHCenterRecord());
records.add(createVCenterRecord());
records.add(createPrintSetupRecord());
// unknown 33
records.add(createFontBasisRecord1());
records.add(createFontBasisRecord2());
records.add(new ProtectRecord(false));
records.add(createUnitsRecord());
records.add(createChartRecord(0, 0, 30434904, 19031616));
records.add(createBeginRecord());
records.add(createSCLRecord((short) 1, (short) 1));
records.add(createPlotGrowthRecord(65536, 65536));
records.add(createFrameRecord1());
records.add(createBeginRecord());
records.add(createLineFormatRecord(true));
records.add(createAreaFormatRecord1());
records.add(createEndRecord());
records.add(createSeriesRecord());
records.add(createBeginRecord());
records.add(createTitleLinkedDataRecord());
records.add(createValuesLinkedDataRecord());
records.add(createCategoriesLinkedDataRecord());
records.add(createDataFormatRecord());
// records.add(createBeginRecord());
// unknown
// records.add(createEndRecord());
records.add(createSeriesToChartGroupRecord());
records.add(createEndRecord());
records.add(createSheetPropsRecord());
records.add(createDefaultTextRecord(DefaultDataLabelTextPropertiesRecord.CATEGORY_DATA_TYPE_ALL_TEXT_CHARACTERISTIC));
records.add(createAllTextRecord());
records.add(createBeginRecord());
// unknown
records.add(createFontIndexRecord(5));
records.add(createDirectLinkRecord());
records.add(createEndRecord());
// eek, undocumented text type
records.add(createDefaultTextRecord((short) 3));
records.add(createUnknownTextRecord());
records.add(createBeginRecord());
records.add(createFontIndexRecord((short) 6));
records.add(createDirectLinkRecord());
records.add(createEndRecord());
records.add(createAxisUsedRecord((short) 1));
createAxisRecords(records);
records.add(createEndRecord());
records.add(createDimensionsRecord());
records.add(createSeriesIndexRecord(2));
records.add(createSeriesIndexRecord(1));
records.add(createSeriesIndexRecord(3));
records.add(EOFRecord.instance);
parentSheet.insertChartRecords(records);
workbook.insertChartRecord();
}
Aggregations