Package org.apache.poi.xssf.usermodel

Examples of org.apache.poi.xssf.usermodel.XSSFWorkbook.createSheet()


        Workbook wb = new XSSFWorkbook()// or new HSSFWorkbook()

        // register the add-in
        wb.addToolPack(new BloombergAddIn());

        Sheet sheet = wb.createSheet();
        Row row = sheet.createRow(0);
        row.createCell(0).setCellFormula("BDP(\"GOOG Equity\",\"CHG_PCT_YTD\")/100");
        row.createCell(1).setCellFormula("BDH(\"goog us equity\",\"EBIT\",\"1/1/2005\",\"12/31/2009\",\"per=cy\",\"curr=USD\") ");
        row.createCell(2).setCellFormula("BDS(\"goog us equity\",\"top_20_holders_public_filings\") ");
View Full Code Here


* Fills and Colors
*/
public class FillsAndColors {
    public static void main(String[] args) throws Exception {
        Workbook wb = new XSSFWorkbook(); //or new HSSFWorkbook();
        Sheet sheet = wb.createSheet("new sheet");

        // Create a row and put some cells in it. Rows are 0 based.
        Row row = sheet.createRow((short) 1);

        // Aqua background
View Full Code Here

*/
public class ScatterChart {

    public static void main(String[] args) throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet = wb.createSheet("Sheet 1");
        final int NUM_OF_ROWS = 3;
        final int NUM_OF_COLUMNS = 10;

        // Create a row and put some cells in it. Rows are 0 based.
        Row row;
View Full Code Here

*/
public class NewLinesInCells {

    public static void main(String[]args) throws Exception {
        Workbook wb = new XSSFWorkbook();   //or new HSSFWorkbook();
        Sheet sheet = wb.createSheet();

        Row row = sheet.createRow(2);
        Cell cell = row.createCell(2);
        cell.setCellValue("Use \n with word wrap on to create a new line");

View Full Code Here

        hlink_font.setUnderline(Font.U_SINGLE);
        hlink_font.setColor(IndexedColors.BLUE.getIndex());
        hlink_style.setFont(hlink_font);

        Cell cell;
        Sheet sheet = wb.createSheet("Hyperlinks");
        //URL
        cell = sheet.createRow(0).createCell((short)0);
        cell.setCellValue("URL Link");

        Hyperlink link = createHelper.createHyperlink(Hyperlink.LINK_URL);
View Full Code Here

        cell.setCellStyle(hlink_style);

        //link to a place in this workbook

        //create a target sheet and cell
        Sheet sheet2 = wb.createSheet("Target Sheet");
        sheet2.createRow(0).createCell((short)0).setCellValue("Target Cell");

        cell = sheet.createRow(3).createCell((short)0);
        cell.setCellValue("Worksheet Link");
        Hyperlink link2 = createHelper.createHyperlink(Hyperlink.LINK_DOCUMENT);
View Full Code Here

public class HeadersAndFooters {


    public static void main(String[]args) throws Exception {
        Workbook wb = new XSSFWorkbook(); //or new HSSFWorkbook();
        Sheet sheet = wb.createSheet("first-header - format sheet");
        sheet.createRow(0).createCell(0).setCellValue(123);

        //set page numbers in the footer
        Footer footer = sheet.getFooter();
        //&P == current page number
View Full Code Here

        for(int i=0;i<100;i=i+10){
            sheet.createRow(i).createCell(0).setCellValue(123);
        }
       
       
        XSSFSheet sheet2 = (XSSFSheet)wb.createSheet("odd header-even footer");
        Header oddHeader=sheet2.getOddHeader();
        //&B == bold
        //&E == double underline
        //&D == date
        oddHeader.setCenter("&B &E oddHeader     &D ");
View Full Code Here

        for(int i=0;i<200;i=i+10){
            sheet2.createRow(i).createCell(0).setCellValue(123);
        }
       
        XSSFSheet sheet3 = (XSSFSheet)wb.createSheet("odd header- odd footer");
        sheet3.createRow(10).createCell(0).setCellValue("Third sheet with oddHeader and oddFooter");
        Header oddH=sheet3.getOddHeader();
        //&C == centered
        oddH.setCenter("centered oddHeader");
        oddH.setLeft("left ");
View Full Code Here

* How to set spklit and freeze panes
*/
public class SplitAndFreezePanes {
    public static void main(String[]args) throws Exception {
        Workbook wb = new XSSFWorkbook();
        Sheet sheet1 = wb.createSheet("new sheet");
        Sheet sheet2 = wb.createSheet("second sheet");
        Sheet sheet3 = wb.createSheet("third sheet");
        Sheet sheet4 = wb.createSheet("fourth sheet");

        // Freeze just one row
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.