Package com.aspose.cells

Examples of com.aspose.cells.Style


   
    Cell cell = cells.get("A5"); //Adding a date/time value to the cell
    cell.setValue(java.util.Calendar.getInstance());
   
    //Setting the display format of the date
    Style style = cell.getStyle();
    style.setNumber(15);
    cell.setStyle(style);
   
    workbook.save("data/DataInCells_Aspose.xls"); //Saving the Excel file

// Print message
View Full Code Here


    //Accessing the "A1" cell from the worksheet     
    Cell cell = cells.get("B2");

    //Adding some value to the "A1" cell
    cell.setValue("Visit Aspose @ www.aspose.com!");
    Style style = cell.getStyle();

    //Setting the line of the top border
    style.setBorder(BorderType.TOP_BORDER,CellBorderType.THICK,Color.getBlack());

    //Setting the line of the bottom border
    style.setBorder(BorderType.BOTTOM_BORDER,CellBorderType.THICK,Color.getBlack());

    //Setting the line of the left border
    style.setBorder(BorderType.LEFT_BORDER,CellBorderType.THICK,Color.getBlack());

    //Setting the line of the right border
    style.setBorder(BorderType.RIGHT_BORDER,CellBorderType.THICK,Color.getBlack());

    //Saving the modified style to the "A1" cell.
    cell.setStyle(style);

    //Saving the Excel file
View Full Code Here

    //Adding some value to cell
    Cell cell = cells.get("A1");
    cell.setValue("This is Aspose test of fonts!");

    //Setting the font name to "Times New Roman"
    Style style = cell.getStyle();
    Font font = style.getFont();
    font.setName("Courier New");
    font.setSize(24);
    font.setBold(true);
    font.setUnderline(FontUnderlineType.SINGLE);
    font.setColor(Color.getBlue());
View Full Code Here

// === Setting Background Pattern ===

//Accessing cell from the worksheet
Cell cell = cells.get("B2");
Style style = cell.getStyle();

//Setting the foreground color to yellow
style.setBackgroundColor(Color.getYellow());

//Setting the background pattern to vertical stripe
style.setPattern(BackgroundType.VERTICAL_STRIPE);

//Saving the modified style to the "A1" cell.
cell.setStyle(style);

// === Setting Foreground ===

//Adding custom color to the palette at 55th index
Color color = Color.fromArgb(212,213,0);
workbook.changePalette(color,55);

//Accessing the "A2" cell from the worksheet
cell = cells.get("B3");

//Adding some value to the cell
cell.setValue("Hello Aspose!");

//Setting the custom color to the font
style = cell.getStyle();
Font font = style.getFont();
font.setColor(color);

cell.setStyle(style);
   
    //Saving the Excel file
View Full Code Here

TOP

Related Classes of com.aspose.cells.Style

Copyright © 2018 www.massapicom. 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.