[]
Use this object to configure the text or picture shown in the left, center, or right section of a page header or footer.
IPageSetup pageSetup = worksheet.getPageSetup();
pageSetup.setDifferentFirstPageHeaderFooter(true);
IPage firstPage = pageSetup.getFirstPage();
firstPage.getCenterHeader().setText("Confidential");
String text = firstPage.getCenterHeader().getText();
Use the returned IHeaderFooter object to configure the text or picture shown in the left section of the header for this page.
worksheet.getPageSetup().setDifferentFirstPageHeaderFooter(true);
IHeaderFooter leftHeader = worksheet.getPageSetup().getFirstPage().getLeftHeader();
leftHeader.setText("Quarterly Report");
IHeaderFooter object that represents the left section of the page header.Use the returned IHeaderFooter object to configure the text or picture shown in the center section of the header for this page.
worksheet.getPageSetup().setDifferentFirstPageHeaderFooter(true);
IHeaderFooter centerHeader = worksheet.getPageSetup().getFirstPage().getCenterHeader();
centerHeader.setText("Confidential");
String text = centerHeader.getText();
IHeaderFooter object that represents the center section of the page header.Use the returned IHeaderFooter object to configure the text or picture shown in the right section of the header for this page.
worksheet.getPageSetup().setDifferentFirstPageHeaderFooter(true);
IHeaderFooter rightHeader = worksheet.getPageSetup().getFirstPage().getRightHeader();
rightHeader.setText("Page 1");
IHeaderFooter object that represents the right section of the page header.