Outlining on Excel Sheet Using JExcel APIs.
Previous | Home | Next |
In this tutorial we will be learning how outline the Excel Sheet Using JExcel APIs.
For outlining an excel sheet using the JExcel API, we have to import the jxl.SheetSettings class which the metlhods for outlining the excel sheet.
For outlining the excel sheet, we use the jxl.SheetSettings class which contains the methods for outlining the excel sheet, like
sheet.getSettings().setTopMargin(int arg);
sheet.getSettings().setLeftMargin(int arg);
sheet.getSettings().setRightMargin(int arg);
sheet.getSettings().setBottomMargin(int arg);
The following code snippet will guide you on how to create outlining in an excel sheet,
WritableWorkbook workbook=Workbook.createWorkbook(new File("F:/JAVA PROJECTS/Jexcel/src/r4r/co/in/firstsheet.xls")); // creating a workbook
WritableSheet sheet=workbook.createSheet("mysheet", 0); // creating a sheeet
Label lbl=new Label(7,7,"Name"); // created a Label
sheet.addCell(lbl); // added the Label to the sheet
sheet.getSettings().setTopMargin(0); // outlining the top part of the sheet
sheet.getSettings().setLeftMargin(0); // outlining the left part of the sheet
sheet.getSettings().setRightMargin(0); // outlining the right part of the sheet
sheet.getSettings().setBottomMargin(0); // outlining the bottom part of the sheet
workbook.write();
workbook.close();
Previous | Home | Next |