Package com.aspose.cells

Examples of com.aspose.cells.Worksheet


    //Instantiating a Workbook object
      Workbook workbook = new Workbook();

    //Adding a new worksheet to the Workbook object
    WorksheetCollection worksheets = workbook.getWorksheets();
    Worksheet worksheet = worksheets.add("My Worksheet");
   
    Cells cells = worksheet.getCells();

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


  public static void main(String[] args) throws Exception
  {
    //Instantiating a Workbook object
    Workbook workbook = new Workbook();

    Worksheet sheet = workbook.getWorksheets().get(0);

    //Adding a picture at the location of a cell whose row and column indices
    //are 5 in the worksheet. It is "F6" cell
    int pictureIndex = sheet.getPictures().add(5,5,"data/xlsx4j/greentick.png");
    Picture picture = sheet.getPictures().get(pictureIndex);

    //Saving the Excel file
    workbook.save("data/xlsx4j/AddImage-Aspose.xlsx",SaveFormat.XLSX);
   
    //Print Message
View Full Code Here

  {
    //Instantiating a Workbook object
    Workbook workbook = new Workbook();

    //Accessing the first worksheet in the Excel file
    Worksheet worksheet = workbook.getWorksheets().get(0);
    Cells cells = worksheet.getCells();

    //Setting the height of all rows in the worksheet to 8
    worksheet.getCells().setStandardHeight(8f);
   
    //Setting the height of the second row to 40
    cells.setRowHeight(1, 40);

    //Saving the modified Excel file in default (that is Excel 2003) format
View Full Code Here

      // Instantiating a Workbook object
        Workbook workbook = new Workbook();

        // Obtaining the reference of the first worksheet
        WorksheetCollection worksheets = workbook.getWorksheets();
        Worksheet sheet = worksheets.get(0);

        // Adding some sample value to cells
        Cells cells = sheet.getCells();
        Cell cell = cells.get("A1");
        cell.setValue(50);
        cell = cells.get("A2");
        cell. setValue (100);
        cell = cells.get("A3");
        cell.setValue(150);
        cell = cells.get("B1");
        cell.setValue(4);
        cell = cells.get("B2");
        cell.setValue(20);
        cell = cells.get("B3");
        cell.setValue(50);

        ChartCollection charts = sheet.getCharts();

        // Adding a chart to the worksheet
        int chartIndex = charts.add(ChartType.PYRAMID,5,0,15,5);
        Chart chart = charts.get(chartIndex);
View Full Code Here

  {
    //Instantiating a Workbook object
    Workbook workbook = new Workbook();

    //Adding a new worksheet to the Workbook object
    Worksheet worksheet = workbook.getWorksheets().get(0);

    //Adding a comment to cell
    int commentIndex = worksheet.getComments().add("A1");
    Comment comment = worksheet.getComments().get(commentIndex);

    //Setting the comment note
    comment.setNote("Hello Aspose!");
   
    //Setting the font size of a comment to 14
View Full Code Here

  {
    //Instantiating a Workbook object
    Workbook workbook = new Workbook("data/workbook.xls");
   
    //Accessing the first worksheet in the Excel file
    Worksheet worksheet = workbook.getWorksheets().get(0);
   
    //Finding the cell containing the specified formula
    Cells cells = worksheet.getCells();
   
    //Instantiate FindOptions
    FindOptions findOptions = new FindOptions();
   
    //Finding the cell containing a string value that starts with "Or"
View Full Code Here

    //Instantiating a Workbook object
    Workbook workbook = new Workbook();
   
    //Accessing the first worksheet in the Workbook file
    WorksheetCollection worksheets = workbook.getWorksheets();
    Worksheet sheet = worksheets.get(0);
   
    //Obtaining the reference of the PageSetup of the worksheet
    PageSetup pageSetup = sheet.getPageSetup();    
   
    //Defining column numbers A & B as title columns
    pageSetup.setPrintTitleColumns("$A:$B");
   
    //Defining row numbers 1 & 2 as title rows
View Full Code Here

    //Create an object for ImageOptions
    ImageOrPrintOptions  imgOptions = new ImageOrPrintOptions ();

    //Get the first worksheet
    Worksheet sheet = book.getWorksheets().get(0);
   
    //Create a SheetRender object with respect to your desired sheet
    SheetRender sr = new SheetRender(sheet, imgOptions);

    //Print the worksheet 
View Full Code Here

    //Instantiating a Workbook object
    Workbook workbook = new Workbook();
   
    //Accessing the first worksheet in the Workbook file
    WorksheetCollection worksheets = workbook.getWorksheets();
    Worksheet sheet = worksheets.get(0);
   
    //Obtaining the reference of the PageSetup of the worksheet
    PageSetup pageSetup = sheet.getPageSetup();    
   
    //Defining column numbers A & B as title columns
    pageSetup.setPrintTitleColumns("$A:$B");
   
    //Defining row numbers 1 & 2 as title rows
View Full Code Here

  {
    //Instantiating a Workbook object
    Workbook workbook = new Workbook("data/workbook.xls");
   
    //Accessing the first worksheet in the Excel file
    Worksheet worksheet = workbook.getWorksheets().get(0);
   
    //Finding the cell containing the specified formula
    Cells cells = worksheet.getCells();
   
    //Instantiate FindOptions
    FindOptions findOptions = new FindOptions();
   
    //Finding the cell containing a string value that starts with "Or"
View Full Code Here

TOP

Related Classes of com.aspose.cells.Worksheet

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.