[]
        
(Showing Draft Content)

SheetEventArgs

Class SheetEventArgs

java.lang.Object
com.grapecity.documents.excel.EventArgs
com.grapecity.documents.excel.SheetEventArgs

public class SheetEventArgs extends EventArgs
Represents EventArgs which contain a Worksheet object;

Use this class to access the IWorksheet involved in workbook sheet events, such as sheet creation, activation, or deletion.


 worksheet.setName("Data");
 SheetEventArgs args = new SheetEventArgs(worksheet);
 IWorksheet sheet = args.getSheet();
 
  • Constructor Details

    • SheetEventArgs

      public SheetEventArgs(IWorksheet sheet)
      Initializes a new instance of the SheetEventArgs class with the specified worksheet.

      The provided worksheet is stored by this instance and can be retrieved by calling getSheet().

      
       worksheet.setName("Data");
       SheetEventArgs args = new SheetEventArgs(worksheet);
       IWorksheet sheet = args.getSheet();
       
      Parameters:
      sheet - The IWorksheet associated with the event arguments. Can be null; the reference is stored as provided.
  • Method Details

    • getSheet

      public final IWorksheet getSheet()
      Gets the worksheet associated with this SheetEventArgs.

      This method returns the IWorksheet instance carried by the event arguments, such as the worksheet provided to workbook sheet-related events.

      
       SheetEventArgs args = new SheetEventArgs(worksheet);
       IWorksheet sheet = args.getSheet();
       String name = sheet.getName();
       
      Returns:
      The IWorksheet associated with this event arguments instance.