Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JSpreadsheet
>
Tutorial
> Set Header
The following example shows you how to set worksheet's header.
import com.independentsoft.office.spreadsheet.Cell; import com.independentsoft.office.spreadsheet.SheetView; import com.independentsoft.office.spreadsheet.Workbook; import com.independentsoft.office.spreadsheet.Worksheet; public class Example { public static void main(String[] args) { try { Worksheet sheet1 = new Worksheet(); sheet1.set("A1",new Cell(100)); Workbook book = new Workbook(); book.getSheets().add(sheet1); sheet1.getHeaderFooterSettings().setOddHeader("test header"); SheetView view1 = new SheetView(); view1.setZoomScale(50); view1.setZoomScaleNormalView(50); view1.setIndex(0); sheet1.getViews().add(view1); book.save("c:\\test\\output.xlsx", true); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*