Package com.aspose.cells

Examples of com.aspose.cells.Worksheet


  {
    //Create a new Workbook.
    Workbook workbook = new Workbook();

    WorksheetCollection worksheets = workbook.getWorksheets();
        Worksheet worksheet1 = worksheets.get(0);
        Worksheet worksheet2 = worksheets.add("Sheet2");
        Worksheet worksheet3 = worksheets.add("Sheet3");
       
    //Move Sheets with in Workbook.
        worksheet2.moveTo(0);
        worksheet1.moveTo(1);
        worksheet3.moveTo(2);

    //Save the excel file.
        workbook.save("data/AsposeMoveSheet.xls");
   
    System.out.println("Sheet moved successfully."); // Print Message
View Full Code Here


    //Instantiating a Excel object by excel file path
    Workbook workbook = new Workbook();

    //Accessing the first worksheet in the Excel file
    WorksheetCollection worksheets = workbook.getWorksheets();
    Worksheet worksheet = worksheets.get(0);

    //Setting the zoom factor of the worksheet to 75    
    worksheet.setZoom(75);

    //Saving the modified Excel file in default format
    workbook.save("data/AsposeZoom.xls");
   
    System.out.println("Aspose Zoom Created.");
View Full Code Here

  {
    //Create a Workbook.
    Workbook wbk = new Workbook();
   
    //Create a Worksheet and get the first sheet.
    Worksheet worksheet = wbk.getWorksheets().get(0);
   
    //Create a Cells object to fetch all the cells.
    Cells cells = worksheet.getCells();
   
    //Merge some Cells (C6:E7) into a single C6 Cell.
    cells.merge(5,2,2,3);
   
    //Input data into C6 Cell.
    worksheet.getCells().get(5,2).setValue("This is a test of merging");
   
    //Save the Workbook.
    wbk.save("data/merge_Aspose.xls");
   
    // Print message
View Full Code Here

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

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

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

    //Adding some value to the "A1" cell
View Full Code Here

        //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");

    //Saving the Excel file
        workbook.save("data/newWorksheet_Aspose.xls");
       
        //Print Message
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();

    // Specifying the cells range (from A1 cell to F20 cell) of the print area
    pageSetup.setPrintArea("A1:F20");

    // Workbooks can be saved in many formats
View Full Code Here

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

    //Accessing the worksheet in the Excel file
    Worksheet worksheet = workbook.getWorksheets().get(0);
    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

        Workbook workbook = new Workbook();

        //Accessing the first worksheet in the Excel file
        WorksheetCollection worksheets = workbook.getWorksheets();

        Worksheet worksheet1 = worksheets.get(0);
        Worksheet worksheet2 = worksheets.add("Sheet2");      

        //Applying freeze panes settings
        worksheet1.freezePanes(0,2,0,2); // Freezing Columns
        worksheet2.freezePanes(2,0,2,0); // Freezing Rows    

        //Saving the modified Excel file in default format
        workbook.save("data/workbook_Aspose.xls");
       
        //Print Message
View Full Code Here

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

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

// === Setting Background Pattern ===

//Accessing cell from the worksheet
Cell cell = cells.get("B2");
View Full Code Here

  public static void main(String[] args) throws Exception
  {
    Workbook workbook = new Workbook("data/workbook.xls");
   
    //Accessing the first worksheet in the Excel file
    Worksheet worksheet = workbook.getWorksheets().get(0);
    Cells cells = worksheet.getCells();
   
    cells.hideRow(2); //Hiding the 3rd row of the worksheet
    cells.hideColumn(1); //Hiding the 2nd column of the worksheet
   
    //Saving the modified Excel file in default (that is Excel 2003) format
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.