Aspose::Cells::Worksheet class
Contents
[
Hide
]Worksheet class
Encapsulates the object that represents a single worksheet.
class Worksheet
Methods
| Method | Description |
|---|---|
| AddPageBreaks(const U16String& cellName) | Adds page break. |
| AddPageBreaks(const char16_t* cellName) | Adds page break. |
| Advanced_Filter(bool isFilter, const U16String& listRange, const U16String& criteriaRange, const U16String& copyTo, bool uniqueRecordOnly) | Filters data using complex criteria. |
| Advanced_Filter(bool isFilter, const char16_t* listRange, const char16_t* criteriaRange, const char16_t* copyTo, bool uniqueRecordOnly) | Filters data using complex criteria. |
| AutoFitColumn(int32_t columnIndex, int32_t firstRow, int32_t lastRow) | Autofits the column width. |
| AutoFitColumn(int32_t columnIndex) | Autofits the column width. |
| AutoFitColumns() | Autofits all columns in this worksheet. |
| AutoFitColumns(const AutoFitterOptions& options) | Autofits all columns in this worksheet. |
| AutoFitColumns(int32_t firstColumn, int32_t lastColumn) | Autofits the columns width. |
| AutoFitColumns(int32_t firstColumn, int32_t lastColumn, const AutoFitterOptions& options) | Autofits the columns width. |
| AutoFitColumns(int32_t firstRow, int32_t firstColumn, int32_t lastRow, int32_t lastColumn) | Autofits the columns width. |
| AutoFitColumns(int32_t firstRow, int32_t firstColumn, int32_t lastRow, int32_t lastColumn, const AutoFitterOptions& options) | Autofits the columns width. |
| AutoFitRow(int32_t rowIndex, int32_t firstColumn, int32_t lastColumn) | Autofits the row height. |
| AutoFitRow(int32_t rowIndex, int32_t firstColumn, int32_t lastColumn, const AutoFitterOptions& options) | Autofits the row height. |
| AutoFitRow(int32_t startRow, int32_t endRow, int32_t startColumn, int32_t endColumn) | Autofits row height in a rectangle range. |
| AutoFitRow(int32_t rowIndex) | Autofits the row height. |
| AutoFitRows() | Autofits all rows in this worksheet. |
| AutoFitRows(bool onlyAuto) | Autofits all rows in this worksheet. |
| AutoFitRows(const AutoFitterOptions& options) | Autofits all rows in this worksheet. |
| AutoFitRows(int32_t startRow, int32_t endRow) | Autofits row height in a range. |
| AutoFitRows(int32_t startRow, int32_t endRow, const AutoFitterOptions& options) | Autofits row height in a range. |
| CalculateArrayFormula(const U16String& formula, const CalculationOptions& opts) | Calculates a formula as array formula. |
| CalculateArrayFormula(const char16_t* formula, const CalculationOptions& opts) | Calculates a formula as array formula. |
| CalculateArrayFormula(const U16String& formula, const CalculationOptions& opts, int32_t maxRowCount, int32_t maxColumnCount) | Calculates a formula as array formula. |
| CalculateArrayFormula(const char16_t* formula, const CalculationOptions& opts, int32_t maxRowCount, int32_t maxColumnCount) | Calculates a formula as array formula. |
| CalculateArrayFormula(const U16String& formula, const FormulaParseOptions& pOpts, const CalculationOptions& cOpts, int32_t baseCellRow, int32_t baseCellColumn, int32_t maxRowCount, int32_t maxColumnCount, const CalculationData& calculationData) | Calculates a formula as array formula. |
| CalculateArrayFormula(const char16_t* formula, const FormulaParseOptions& pOpts, const CalculationOptions& cOpts, int32_t baseCellRow, int32_t baseCellColumn, int32_t maxRowCount, int32_t maxColumnCount, const CalculationData& calculationData) | Calculates a formula as array formula. |
| CalculateFormula(const U16String& formula) | Calculates a formula. |
| CalculateFormula(const char16_t* formula) | Calculates a formula. |
| CalculateFormula(const U16String& formula, const CalculationOptions& opts) | Calculates a formula expression directly. |
| CalculateFormula(const char16_t* formula, const CalculationOptions& opts) | Calculates a formula expression directly. |
| CalculateFormula(const U16String& formula, const FormulaParseOptions& pOpts, const CalculationOptions& cOpts, int32_t baseCellRow, int32_t baseCellColumn, const CalculationData& calculationData) | Calculates a formula expression directly. |
| CalculateFormula(const char16_t* formula, const FormulaParseOptions& pOpts, const CalculationOptions& cOpts, int32_t baseCellRow, int32_t baseCellColumn, const CalculationData& calculationData) | Calculates a formula expression directly. |
| CalculateFormula(const CalculationOptions& options, bool recursive) | Calculates all formulas in this worksheet. |
| ClearComments() | Clears all comments in designer spreadsheet. |
| CloseAccessCache(AccessCacheOptions opts) | Closes the session that uses caches to access the data in this worksheet. |
| ConvertFormulaReferenceStyle(const U16String& formula, bool toR1C1, int32_t baseCellRow, int32_t baseCellColumn) | Converts the formula reference style. |
| ConvertFormulaReferenceStyle(const char16_t* formula, bool toR1C1, int32_t baseCellRow, int32_t baseCellColumn) | Converts the formula reference style. |
| Copy(const Worksheet& sourceSheet) | Copies contents and formats from another worksheet. |
| Copy(const Worksheet& sourceSheet, const CopyOptions& copyOptions) | Copies contents and formats from another worksheet. |
| Dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
| FreezePanes(int32_t row, int32_t column, int32_t freezedRows, int32_t freezedColumns) | Freezes panes at the specified cell in the worksheet. |
| FreezePanes(const U16String& cellName, int32_t freezedRows, int32_t freezedColumns) | Freezes panes at the specified cell in the worksheet. |
| FreezePanes(const char16_t* cellName, int32_t freezedRows, int32_t freezedColumns) | Freezes panes at the specified cell in the worksheet. |
| GetActiveCell() | Gets or sets the active cell in the worksheet. |
| GetAdvancedFilter() | Gets the settings of advanced filter. |
| GetAllowEditRanges() | Gets the allow edit range collection in the worksheet. |
| GetAutoFilter() | Represents auto filter for the specified worksheet. |
| GetBackgroundImage() | Gets and sets worksheet background image. |
| GetCells() | Gets the Cells collection. |
| GetCellWatches() | Gets collection of cells on this worksheet being watched in the ‘watch window’. |
| GetCharts() | Gets a Chart collection. |
| GetCheckBoxes() | Gets a CheckBox collection. |
| GetCodeName() | Gets worksheet code name. |
| GetComments() | Gets the Comment collection. |
| GetConditionalFormattings() | Gets the ConditionalFormattings in the worksheet. |
| GetCustomProperties() | Gets an object representing the identifier information associated with a worksheet. |
| GetDisplayRightToLeft() | Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false. |
| GetDisplayZeros() | True if zero values are displayed. |
| GetErrorCheckOptions() | Gets error check setting applied on certain ranges. |
| GetFirstVisibleColumn() | Represents first visible column index. |
| GetFirstVisibleRow() | Represents first visible row index. |
| GetFreezedPanes(int32_t& row, int32_t& column, int32_t& freezedRows, int32_t& freezedColumns) | Gets the freeze panes. |
| GetGridlineColor() | Gets and sets the color of gridline. |
| GetHasAutofilter() | Indicates whether this worksheet has auto filter. |
| GetHorizontalPageBreaks() | Gets the HorizontalPageBreakCollection collection. |
| GetHyperlinks() | Gets the HyperlinkCollection collection. |
| GetIndex() | Gets the index of sheet in the worksheet collection. |
| GetListObjects() | Gets all ListObjects in this worksheet. |
| GetName() | Gets or sets the name of the worksheet. |
| GetOleObjects() | Represents a collection of OleObject in a worksheet. |
| GetOutline() | Gets the outline on this worksheet. |
| GetPageSetup() | Represents the page setup description in this sheet. |
| GetPanes() | Gets the window panes. |
| GetPaneState() | Indicates whether the pane has horizontal or vertical splits, and whether those splits are frozen. |
| GetPictures() | Gets a Picture collection. |
| GetPivotTables() | Gets all pivot tables in this worksheet. |
| GetPrintingPageBreaks(const ImageOrPrintOptions& options) | Gets automatic page breaks. |
| GetProtection() | Represents the various types of protection options available for a worksheet. Supports advanced protection options in ExcelXP and above version. |
| GetQueryTables() | Gets QueryTableCollection in the worksheet. |
| GetScenarios() | Gets the collection of Scenario. |
| GetSelectedAreas() | Gets selected ranges of cells in the designer spreadsheet. |
| GetShapes() | Returns all drawing shapes in this worksheet. |
| GetShowFormulas() | Indicates whether to show formulas or their results. |
| GetSlicers() | Get the Slicer collection in the worksheet. |
| GetSmartTagSetting() | Gets all SmartTagCollection objects of the worksheet. |
| GetSparklineGroups() | Gets the sparkline groups in the worksheet. |
| GetTabColor() | Represents worksheet tab color. |
| GetTabId() | Specifies the internal identifier for the sheet. |
| GetTextBoxes() | Gets a TextBox collection. |
| GetTimelines() | Get the Timeline collection in the worksheet. |
| GetTransitionEntry() | Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled. |
| GetTransitionEvaluation() | Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled. |
| GetType() | Represents worksheet type. |
| GetUniqueId() | Gets and sets the unique id, it is same as {15DB5C3C-A5A1-48AF-8F25-3D86AC232D4F}. |
| GetValidations() | Gets the data validation setting collection in the worksheet. |
| GetVerticalPageBreaks() | Gets the VerticalPageBreakCollection collection. |
| GetViewType() | Gets and sets the view type. |
| GetVisibilityType() | Indicates the visible state for this sheet. |
| GetWorkbook() | Gets the workbook object which contains this sheet. |
| GetZoom() | Represents the scaling factor in percentage. It should be between 10 and 400. |
| IsGridlinesVisible() | Gets or sets a value indicating whether the gridlines are visible.Default is true. |
| IsNull() const | Checks whether the implementation object is nullptr. |
| IsOutlineShown() | Indicates whether to show outline. |
| IsPageBreakPreview() | Indicates whether the specified worksheet is shown in normal view or page break preview. |
| IsProtected() | Indicates if the worksheet is protected. |
| IsRowColumnHeadersVisible() | Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true. |
| IsRulerVisible() | Indicates whether the ruler is visible. This property is only applied for page break preview. |
| IsSelected() | Indicates whether this worksheet is selected when the workbook is opened. |
| IsVisible() | Represents if the worksheet is visible. |
| MoveTo(int32_t index) | Moves the sheet to another location in the spreadsheet. |
| explicit operator bool() const | operator bool() |
| operator=(const Worksheet& src) | operator= |
| Protect(ProtectionType type) | Protects worksheet. |
| Protect(ProtectionType type, const U16String& password, const U16String& oldPassword) | Protects worksheet. |
| Protect(ProtectionType type, const char16_t* password, const char16_t* oldPassword) | Protects worksheet. |
| RefreshPivotTables() | Refreshes all the PivotTables in this Worksheet. |
| RefreshPivotTables(const PivotTableRefreshOption& option) | Refreshes all the PivotTables in this Worksheet. |
| RemoveAllDrawingObjects() | Removes all drawing objects in this worksheet. |
| RemoveAutoFilter() | Removes the auto filter of the worksheet. |
| RemoveSplit() | Removes split window. |
| Replace(const U16String& oldString, const U16String& newString) | Replaces all cells’ text with a new string. |
| Replace(const char16_t* oldString, const char16_t* newString) | Replaces all cells’ text with a new string. |
| SelectRange(int32_t startRow, int32_t startColumn, int32_t totalRows, int32_t totalColumns, bool removeOthers) | Selects a range. |
| SetActiveCell(const U16String& value) | Gets or sets the active cell in the worksheet. |
| SetActiveCell(const char16_t* value) | Gets or sets the active cell in the worksheet. |
| SetBackgroundImage(const Vector <uint8_t>& value) | Gets and sets worksheet background image. |
| SetCodeName(const U16String& value) | Gets worksheet code name. |
| SetCodeName(const char16_t* value) | Gets worksheet code name. |
| SetDisplayRightToLeft(bool value) | Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false. |
| SetDisplayZeros(bool value) | True if zero values are displayed. |
| SetFirstVisibleColumn(int32_t value) | Represents first visible column index. |
| SetFirstVisibleRow(int32_t value) | Represents first visible row index. |
| SetGridlineColor(const Aspose::Cells::Color& value) | Gets and sets the color of gridline. |
| SetIsGridlinesVisible(bool value) | Gets or sets a value indicating whether the gridlines are visible.Default is true. |
| SetIsOutlineShown(bool value) | Indicates whether to show outline. |
| SetIsPageBreakPreview(bool value) | Indicates whether the specified worksheet is shown in normal view or page break preview. |
| SetIsRowColumnHeadersVisible(bool value) | Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true. |
| SetIsRulerVisible(bool value) | Indicates whether the ruler is visible. This property is only applied for page break preview. |
| SetIsSelected(bool value) | Indicates whether this worksheet is selected when the workbook is opened. |
| SetIsVisible(bool value) | Represents if the worksheet is visible. |
| SetName(const U16String& value) | Gets or sets the name of the worksheet. |
| SetName(const char16_t* value) | Gets or sets the name of the worksheet. |
| SetShowFormulas(bool value) | Indicates whether to show formulas or their results. |
| SetTabColor(const Aspose::Cells::Color& value) | Represents worksheet tab color. |
| SetTabId(int32_t value) | Specifies the internal identifier for the sheet. |
| SetTransitionEntry(bool value) | Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled. |
| SetTransitionEvaluation(bool value) | Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled. |
| SetType(SheetType value) | Represents worksheet type. |
| SetUniqueId(const U16String& value) | Gets and sets the unique id, it is same as {15DB5C3C-A5A1-48AF-8F25-3D86AC232D4F}. |
| SetUniqueId(const char16_t* value) | Gets and sets the unique id, it is same as {15DB5C3C-A5A1-48AF-8F25-3D86AC232D4F}. |
| SetViewType(ViewType value) | Gets and sets the view type. |
| SetVisibilityType(VisibilityType value) | Indicates the visible state for this sheet. |
| SetVisible(bool isVisible, bool ignoreError) | Sets the visible options. |
| SetZoom(int32_t value) | Represents the scaling factor in percentage. It should be between 10 and 400. |
| Split() | Splits window. |
| StartAccessCache(AccessCacheOptions opts) | Starts the session that uses caches to access the data in this worksheet. |
| ToString() | Returns a string represents the current Worksheet object. |
| UnFreezePanes() | Unfreezes panes in the worksheet. |
| Unprotect() | Unprotects worksheet. |
| Unprotect(const U16String& password) | Unprotects worksheet. |
| Unprotect(const char16_t* password) | Unprotects worksheet. |
| Worksheet(Worksheet_Impl* impl) | Constructs from an implementation object. |
| Worksheet(const Worksheet& src) | Copy constructor. |
| ~Worksheet() | Destructor. |
Fields
| Field | Description |
|---|---|
| _impl | The implementation object. |
Examples
Aspose::Cells::Startup();
//The following example shows how to freeze panes and insert hyperlink to worksheet with .Net or VB.
Workbook workbook;
Worksheet sheet = workbook.GetWorksheets().Get(0);
//Freeze panes at "AS40" with 10 rows and 10 columns
sheet.FreezePanes(u"AS40", 10, 10);
//Add a hyperlink in Cell A1
sheet.GetHyperlinks().Add(u"A1", 1, 1, u"http://www.aspose.com");
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells
- Library Aspose.Cells for C++