### Examples Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.WinFormsUtilities.ImportFromDataGridViewOptions Example usage of the ImportFromDataGridViewOptions class. ```APIDOC ## Examples Import and Export Excel to DataGridView in C# and VB.NET ``` -------------------------------- ### Initialize Certificate from File (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Security.Certificate Creates a new Certificate instance by loading certificate data from a specified file. The fileName parameter should be the path to the certificate file. This constructor will throw an ArgumentNullException if the fileName is null. ```csharp public Certificate(string fileName) ``` -------------------------------- ### Set and Get FirstSliceAngle for PieChart (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Charts.PieChart Gets or sets the starting angle for the first slice of a pie chart. The value must be an integer between 0 and 360 degrees. ```csharp public int FirstSliceAngle { get; set; } ``` -------------------------------- ### Set and Get FirstSliceAngle for PieChart (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Charts.PieChart Gets or sets the starting angle for the first slice of a pie chart in VB.NET. The value must be an integer between 0 and 360 degrees. ```vbnet Public Property FirstSliceAngle As Integer ``` -------------------------------- ### LoadWithOptions Method Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Loads a spreadsheet from a file with specified path and loading options. ```APIDOC ## LoadWithOptions(String, Object) ### Description Loads a spreadsheet from a file with the specified path. ### Method N/A (Instance Method) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **path** (String) - Required - The path from which to load a spreadsheet. - **options** (Object) - Required - The loading options which can be used to define settings for load operation. ### Request Example ```csharp // Assuming 'loadOptions' is a LoadOptions object ExcelFile file = ComHelper.LoadWithOptions("C:\path\to\your\spreadsheet.csv", loadOptions); ``` ### Response #### Success Response (200) - **ExcelFile** (ExcelFile) - A loaded spreadsheet. #### Response Example ```json { "filePath": "C:\path\to\your\spreadsheet.csv", "worksheets": [ // ... worksheet details ] } ``` ``` -------------------------------- ### Initialize ImportFromDataGridViewOptions in C# and VB.NET Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.WinFormsUtilities.ImportFromDataGridViewOptions Provides constructors for initializing the ImportFromDataGridViewOptions class. Options include default initialization, specifying start row and column indices, or a starting cell name. ```csharp public ImportFromDataGridViewOptions() ``` ```vbnet Public Sub New ``` ```csharp public ImportFromDataGridViewOptions(int startRow, int startColumn) ``` ```vbnet Public Sub New(startRow As Integer, startColumn As Integer) ``` ```csharp public ImportFromDataGridViewOptions(string startCell) ``` ```vbnet Public Sub New(startCell As String) ``` -------------------------------- ### Get Start Position Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellRange Retrieves the name of the first (top-left) cell within this cell range. ```C# public string StartPosition { get; } ``` ```VB.NET Public ReadOnly Property StartPosition As String ``` -------------------------------- ### Get Formatted Character Range in C# and VB.NET Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.AbstractRange Retrieves a `FormattedCharacterRange` object for a portion of cell text, starting at a specified index. This method is applicable only to cells with string values and has limitations on the starting index and range size. ```csharp public FormattedCharacterRange GetCharacters(int startIndex) ``` ```vb.net Public Function GetCharacters(startIndex As Integer) As FormattedCharacterRange ``` -------------------------------- ### Initialize Certificate from File (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Security.Certificate Initializes a new Certificate object in Visual Basic .NET by reading certificate information from a file. The fileName parameter specifies the path to the certificate file. A null value for fileName will result in an ArgumentNullException. ```vbnet Public Sub New(fileName As String) ``` -------------------------------- ### ComSetLicense Method Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Sets the GemBox.Spreadsheet serial key for the COM interop. ```APIDOC ## ComSetLicense(String) ### Description Call this method from your application to set GemBox.Spreadsheet serial key. ### Method N/A (Instance Method) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **serialKey** (String) - Required - Serial key. ### Request Example ```csharp // Set the license key ComHelper.ComSetLicense("YOUR-SERIAL-KEY"); ``` ### Response #### Success Response (200) Void (No return value) #### Response Example N/A ### Remarks You should call this method before using any other class from GemBox.Spreadsheet library. Key can only be set once (if you try second key, exception will be thrown). The best place to call this method is from static constructor of your application's main class. Valid serial key has multiple groups of alphanumeric characters, separated with dashes. Free version serial key is: **FREE-LIMITED-KEY**. ``` -------------------------------- ### FormattedCharacterRange StartIndex Property (C# and VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.FormattedCharacterRange Gets the zero-based starting character position of the FormattedCharacterRange. The StartIndex property returns an integer value. ```csharp public int StartIndex { get; } ``` ```vb.net Public ReadOnly Property StartIndex As Integer ``` -------------------------------- ### Get Characters API Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.AbstractRange Returns a FormattedCharacterRange object representing a range of characters within the cell text, starting at a specified position. ```APIDOC ## GET /GetCharacters ### Description Returns a FormattedCharacterRange object that represents a range of characters within the cell text. The range starts at a specified character position. ### Method GET ### Endpoint /websites/gemboxsoftware_spreadsheet/GetCharacters ### Parameters #### Path Parameters None #### Query Parameters - **startIndex** (integer) - Required - The zero-based starting character position. - **length** (integer) - Optional - The number of characters. ### Request Example ```json { "startIndex": 0, "length": 5 } ``` ### Response #### Success Response (200) - **FormattedCharacterRange** (object) - A new FormattedCharacterRange object. #### Response Example ```json { "formattedCharacterRange": { "startIndex": 0, "length": 5 } } ``` #### Exceptions - **ArgumentOutOfRangeException**: If `startIndex` is less than zero or greater than or equal to 32767. - **ArgumentOutOfRangeException**: If `length` is less than or equal to zero or greater than 32767. ``` -------------------------------- ### Initialize Certificate from Object (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Security.Certificate Constructs a new instance of the Certificate class using an existing object as the source. The source object is expected to be an instance of System.Security.Cryptography.X509Certificates.X509Certificate2. An ArgumentException is thrown if the source is not of the correct type. ```csharp public Certificate(object source) ``` -------------------------------- ### Get PivotItem Parent PivotField (C#, VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.PivotTables.PivotItem This snippet demonstrates how to access the parent PivotField of a PivotItem. Examples are provided in C# and VB.NET. ```csharp public PivotField PivotField { get; } ``` ```vb.net Public ReadOnly Property PivotField As PivotField ``` -------------------------------- ### ComHelper Constructors Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Provides information on how to initialize the ComHelper class. ```APIDOC ## ComHelper() ### Description Initializes a new instance of the ComHelper class. ### Method Constructor ### Endpoint N/A ### Parameters None ### Request Example ```csharp ComHelper helper = new ComHelper(); ``` ### Response ### Success Response (200) N/A ### Response Example N/A ``` -------------------------------- ### SortState Class Overview Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.SortState Provides an overview of the SortState class, its namespace, and assembly information. ```APIDOC ## SortState Class ### Namespace GemBox.Spreadsheet ### Assembly GemBox.Spreadsheet.dll ### Description Represents sort settings and provides sort functionality. ### Inheritance System.Object SortState ### Remarks Use Sort(Boolean) method to create or get a SortState instance. Active SortState is stored in the parent worksheet (Sort) and is loaded from and saved to XLSX file. ``` -------------------------------- ### Set StartRow for Data Extraction Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExtractToDataTableOptions Gets or sets the index of the first row from which data extraction begins. This property defines the starting point for reading data from the Excel worksheet. ```C# public int StartRow { get; set; } ``` ```VB.NET Public Property StartRow As Integer ``` -------------------------------- ### Load Spreadsheet with Options (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Loads a spreadsheet from a file path using specified loading options. This method allows for customization of the loading process. It takes the file path and an options object. ```csharp public ExcelFile LoadWithOptions(string path, object options) ``` -------------------------------- ### HasFormulas Property (C# / VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CsvLoadOptions Gets or sets a boolean value indicating whether text starting with '=' should be treated as a formula. Defaults to false. Available in C# and VB.NET. ```csharp public bool HasFormulas { get; set; } ``` ```vbnet Public Property HasFormulas As Boolean ``` -------------------------------- ### HasFormulas Property (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.HtmlLoadOptions Gets or sets a boolean value in VB.NET that determines if text starting with '=' is interpreted as a formula. This setting affects how mathematical expressions within HTML are handled during import. ```vbnet Public Property HasFormulas As Boolean ``` -------------------------------- ### File Handling and Options Classes Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet Classes for loading, saving, and configuring spreadsheet files and their content. ```APIDOC ## File Handling and Options Classes This section describes classes related to file operations, import/export options, and document properties. ### Classes - **CopyOptions**: Represents the options used when copying a cell range. - **CreateDataTableOptions**: Represents options creating System.Data.DataTable and filling it with values from ExcelWorksheet. - **CsvLoadOptions**: Represents options for loading from Character Separated Values file format. - **CsvSaveOptions**: Represents options for saving to Character Separated Values file format. - **DigitalSignatureSaveOptions**: Represents a class that stores details for signing a workbook with a digital signature. - **DocumentProperties**: Contains a collection of built-in and custom document properties. - **ExcelFile**: Excel file contains one or more worksheets (ExcelWorksheet) and workbook related properties and methods. - **ExcelFilePage**: Represents a workbook page. - **ExcelFilePaginator**: Provides functionality to paginate the workbook content. - **ExcelFileStore**: Represents a collection of application-specific ExcelFile instances. - **ExcelPrintOptions**: Stores MS Excel print and print related options. ``` -------------------------------- ### HasFormulas Property (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.HtmlLoadOptions Gets or sets a boolean value indicating whether text starting with '=' should be treated as a formula in C#. This is useful when importing HTML that contains spreadsheet-like formula notation. ```csharp public bool HasFormulas { get; set; } ``` -------------------------------- ### Load Method Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Loads a spreadsheet from a file at the specified path, automatically detecting the file format. ```APIDOC ## Load(String) ### Description Loads a spreadsheet from a file with the specified path. ### Method N/A (Instance Method) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **path** (String) - Required - The path from which to load a spreadsheet. ### Request Example ```csharp ExcelFile file = ComHelper.Load("C:\path\to\your\spreadsheet.xlsx"); ``` ### Response #### Success Response (200) - **ExcelFile** (ExcelFile) - A loaded spreadsheet. #### Response Example ```json { "filePath": "C:\path\to\your\spreadsheet.xlsx", "worksheets": [ // ... worksheet details ] } ``` ### Remarks File extension that is extracted from the `path` is used to create the appropriate LoadOptions derived class instance that is then passed to the Load(String, LoadOptions) method. Following file extensions are supported: Microsoft Excel: .xlsx, xlsm, .xltx, .xltm, .xls, .xlt; OpenDocument Spreadsheet: .ods, .ots; Character Separated Values: .csv, .tsv; HyperText Markup Language: .htm, .html, .mht, .mhtml ``` -------------------------------- ### HeaderFooterPage Constructor Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.HeaderFooterPage Initializes a new instance of the HeaderFooterPage class. ```APIDOC ## HeaderFooterPage() ### Description HeaderFooterPage constructor. ### Method Constructor ### Endpoint N/A ### Parameters None ### Request Example ```csharp var headerFooterPage = new GemBox.Spreadsheet.HeaderFooterPage(); ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### ContainValueCondition Value Property Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ConditionalFormatting.ContainValueCondition Gets or sets the value for the ContainValueCondition. This can be a constant or a formula. If constant, it must be non-null and of a supported type. If a formula, it must be a string starting with '='. Supported in C# and VB.NET. ```C# public object Value { get; set; } ``` ```VB.NET Public Property Value As Object ``` -------------------------------- ### Load Spreadsheet with Options (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Loads a spreadsheet from a file path with custom loading options in VB.NET. This provides flexibility in how the spreadsheet is read. It requires the file path and an options object. ```vbnet Public Function LoadWithOptions(path As String, options As Object) As ExcelFile ``` -------------------------------- ### ContainTextCondition Value Property (C# and VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ConditionalFormatting.ContainTextCondition Gets or sets the text value for the ContainTextCondition. This can be a constant string or a formula starting with '='. Throws ArgumentNullException if the value is null. Available in C# and VB.NET. ```csharp public string Value { get; set; } ``` ```vbnet Public Property Value As String ``` -------------------------------- ### XlsbLoadOptions Constructor Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.XlsbLoadOptions Initializes a new instance of the XlsbLoadOptions class. This constructor does not require any parameters. ```C# public XlsbLoadOptions() ``` ```VB.NET Public Sub New ``` -------------------------------- ### Set Doughnut Chart First Slice Angle (C# and VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Charts.DoughnutChart Gets or sets the starting angle for the first slice of the doughnut chart. The value must be between 0 and 360 degrees. ```csharp public int FirstSliceAngle { get; set; } ``` ```vbnet Public Property FirstSliceAngle As Integer ``` -------------------------------- ### Value Property for Top10Filter (C# and VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Top10Filter Gets or sets the numeric value for the top or bottom filter criteria. Must be greater than zero. For example, '10' for Top 10 Percent or Top 5 Items. ```csharp public double Value { get; set; } ``` ```vbnet Public Property Value As Double ``` -------------------------------- ### Initialize Certificate from Object (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Security.Certificate Initializes a new Certificate object in Visual Basic .NET from a provided source object. This constructor requires the source to be compatible with System.Security.Cryptography.X509Certificates.X509Certificate2. If the provided object is not of the expected type, an exception will be raised. ```vbnet Public Sub New(source As Object) ``` -------------------------------- ### Set Font Base Directory (C# and VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.FontSettings Gets or sets the base directory path where the component searches for fonts. This path can be absolute or relative to the current working directory. Useful for environments without installed fonts. ```csharp public static string FontsBaseDirectory { get; set; } ``` ```vbnet Public Shared Property FontsBaseDirectory As String ``` -------------------------------- ### SaveWithOptions Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Saves the spreadsheet to a file with the specified path and saving options. ```APIDOC ## POST /websites/gemboxsoftware_spreadsheet/SaveWithOptions ### Description Saves the spreadsheet to a file with the specified path and saving options. ### Method POST ### Endpoint /websites/gemboxsoftware_spreadsheet/SaveWithOptions ### Parameters #### Request Body - **file** (Object) - Required - The ExcelFile instance to save. - **path** (String) - Required - The path to which to save the spreadsheet. - **options** (Object) - Optional - The saving options which can be used to define settings for the save operation. ### Request Example ```json { "file": "", "path": "/path/to/save/spreadsheet.xlsx", "options": "" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure of the operation. #### Response Example ```json { "status": "Spreadsheet saved successfully" } ``` ``` -------------------------------- ### Get PivotCacheSource Type (C# and VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.PivotTables.PivotCacheSource Retrieves the specific type of the PivotCache source. This property is abstract, meaning derived classes must provide their implementation to indicate whether the source is, for example, a worksheet or an external data source. ```csharp public abstract PivotCacheSourceType SourceType { get; } ``` ```vbnet Public MustOverride ReadOnly Property SourceType As PivotCacheSourceType ``` -------------------------------- ### PrintOptions Constructor Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.PrintOptions Initializes a new instance of the PrintOptions class. An overloaded constructor allows initialization using an XML stream conforming to the Print Schema. ```C# public PrintOptions() public PrintOptions(MemoryStream xmlStream) ``` ```VB.NET Public Sub New Public Sub New(xmlStream As MemoryStream) ``` -------------------------------- ### Get Characters in ExcelComment (C#, VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelComment Retrieves a range of characters from the comment text. It takes a starting index and a length as input and returns a FormattedCharacterRange object. Supported in XLSX, XLSB and XLS formats. Throws ArgumentOutOfRangeException for invalid input. ```csharp public FormattedCharacterRange GetCharacters(int startIndex, int length) ``` ```vb.net Public Function GetCharacters(startIndex As Integer, length As Integer) As FormattedCharacterRange ``` -------------------------------- ### Set License Key (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Sets the GemBox.Spreadsheet serial key for the current application session. This method should be called before any other GemBox.Spreadsheet operations. It accepts a string representing the serial key. ```csharp public void ComSetLicense(string serialKey) ``` -------------------------------- ### Get Excel Cell by Relative Row and Column Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellRange Retrieves an Excel cell from a range using its zero-based relative row and column positions. The absolute position is calculated by adding these relative values to the range's starting row and column indices. ```C# public ExcelCell this[int relativeRow, int relativeColumn] { get; } ``` ```VB.NET Public ReadOnly Property Item(relativeRow As Integer, relativeColumn As Integer) As ExcelCell ``` -------------------------------- ### PrintOptions FromPage Property Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.PrintOptions Gets or sets the zero-based index of the first page to print. Spreadsheet pages are zero-indexed. ```C# public int FromPage { get; set; } ``` ```VB.NET Public Property FromPage As Integer ``` -------------------------------- ### ExcelFile Constructor Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelFile Initializes a new instance of the ExcelFile class with an empty workbook (no worksheets). Worksheets can be added using the Worksheets property or Add methods. ```APIDOC ## Constructor ExcelFile() ### Description Initializes an empty (no worksheets) instance of the ExcelFile class. ### Remarks To add new worksheets to a blank file use Worksheets property, Add(String) or Add(SheetType, String) methods. To load / read a spreadsheet from a file or a stream, use static Load(String) methods. To save / write a spreadsheet to a file or a stream use Save(String) methods. ``` -------------------------------- ### Get Formatted Character Range with Length in C# and VB.NET Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.AbstractRange Returns a `FormattedCharacterRange` object for a specified segment of cell text, defined by a starting index and length. This method requires the cell to contain string data and enforces constraints on the provided indices and length. ```csharp public FormattedCharacterRange GetCharacters(int startIndex, int length) ``` ```vb.net Public Function GetCharacters(startIndex As Integer, length As Integer) As FormattedCharacterRange ``` -------------------------------- ### Get Subrange using Start and End Cell Names (C#, VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellRange Returns a new cell range using the names of the first (top-left) and last (bottom-right) cells. The new range must be within the current cell range. Throws ArgumentOutOfRangeException if arguments are out of range. ```C# public CellRange GetSubrange(string firstCell, string lastCell) ``` ```VB.NET Public Function GetSubrange(firstCell As String, lastCell As String) As CellRange ``` -------------------------------- ### Initialize ComHelper Class (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Provides the default constructor for the ComHelper class in C#. This method initializes a new instance of the ComHelper. ```csharp public ComHelper() ``` -------------------------------- ### Get Subrange Absolute Cell Range (C#, VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellRange Returns a new cell range using absolute indexing. This method requires four integer arguments specifying the absolute row and column indices for the start and end of the desired range. The new range must be within the bounds of the current cell range. ```csharp public CellRange GetSubrangeAbsolute(int firstAbsoluteRow, int firstAbsoluteColumn, int lastAbsoluteRow, int lastAbsoluteColumn) ``` ```vb.net Public Function GetSubrangeAbsolute(firstAbsoluteRow As Integer, firstAbsoluteColumn As Integer, lastAbsoluteRow As Integer, lastAbsoluteColumn As Integer) As CellRange ``` -------------------------------- ### Load from Stream with LoadOptions Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelFile Loads a spreadsheet from the specified stream using the provided `LoadOptions` to configure the loading process. ```APIDOC ## Load(Stream, LoadOptions) ### Description Loads a spreadsheet from the specified stream. ### Method `public static ExcelFile Load(Stream stream, LoadOptions options)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp // Assuming 'fileStream' is an instance of System.IO.Stream and 'loadOptions' is a LoadOptions object ExcelFile loadedFile = ExcelFile.Load(fileStream, loadOptions); ``` ### Response #### Success Response (200) - **ExcelFile** - A loaded spreadsheet object. #### Response Example ```json // The returned value is an ExcelFile object, not a JSON representation. // Example: // ExcelFile file = ...; ``` ``` -------------------------------- ### WpfHelper Class Documentation Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.WpfHelper Documentation for the WpfHelper class, including its namespace, assembly, and purpose. ```APIDOC ## WpfHelper Class ### Description Provides helper methods for dealing with Windows Presentation Foundation (WPF) dispatcher resource leaks in multithreaded applications. ### Namespace GemBox.Spreadsheet ### Assembly GemBox.Spreadsheet.dll ### Remarks GemBox uses or might use WPF for operations like printing, converting to XPS or ImageSource, saving to XPS/image files, getting framework element content, bitmap decoding/encoding, rasterizing vectorized content, text shaping, color conversions, and clipboard operations. For mandatory WPF operations, GemBox creates a dedicated thread with a Dispatcher, uses WPF, and shuts down the Dispatcher before the thread terminates. For optional WPF operations, alternatives like Skia or GDI+ may be used. If WPF is used in a non-WPF application or on a non-UI thread in a WPF application, a Dispatcher instance is implicitly created per thread. This Dispatcher must be shut down before the thread terminates to prevent resource leaks. GemBox avoids creating Dispatchers in threads that do not already have one or if it has been shut down, except in specific scenarios. ### Important Considerations - GemBox guarantees its code won't initiate Dispatcher creation in existing threads unless explicitly allowed or in specific background threads. - For operations where WPF is mandatory, GemBox uses a separate thread to prevent leaks in the calling thread. - You should only manually create and shut down a Dispatcher (using `CreateDispatcherForCurrentThread()` and `DispatcherShutdowner`) if you created the current thread or it's the main application thread. Doing so on managed thread pool threads or threads where subsequent code might need a Dispatcher can cause issues. ### Methods #### CreateDispatcherForCurrentThread() Utility method to create a Dispatcher instance for the current thread. Returns a `WpfHelper.DispatcherShutdowner` that must be disposed to shut down the Dispatcher and prevent resource leaks. ### Properties (No specific properties are detailed in the provided text, but the class likely contains static members or internal properties related to its functionality.) ``` -------------------------------- ### Set or Get Rich Value Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellRange Sets or gets the rich text value for one or more cells in a range. Getting the rich value is only meaningful for merged ranges; otherwise, an exception is thrown. ```C# public override RichValueBase RichValue { get; set; } ``` ```VB.NET Public Overrides Property RichValue As RichValueBase ``` -------------------------------- ### Initialize ComHelper Class (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Provides the default constructor for the ComHelper class in VB.NET. This method initializes a new instance of the ComHelper. ```vbnet Public Sub New ``` -------------------------------- ### Set or Get Value Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellRange Sets or gets the value for one or more cells in a range. Getting the value is only meaningful for merged ranges; otherwise, an exception is thrown. This property overrides the base class's Value property. ```C# public override object Value { get; set; } ``` ```VB.NET Public Overrides Property Value As Object ``` -------------------------------- ### Initialize FixedWidthColumn with Width (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.FixedWidthColumn Initializes a new instance of the FixedWidthColumn class with a specified column width in C#. ```csharp public FixedWidthColumn(int width) ``` -------------------------------- ### Cell and Range Formatting Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellStyle Explains how to apply formatting to individual cells and ranges, including performance considerations. ```APIDOC ## Cell and Range Formatting ### Description Cell formatting can be accessed and modified through the `Style` property available on `ExcelCell` and `CellRange` types. Formatting specified on `ExcelColumn` and `ExcelRow` is propagated to their cells. ### Performance Considerations - **CellRange Formatting**: For performance reasons, cell formatting on a `CellRange` is resolved based on its top-left cell's formatting, except for borders, which are resolved based on corner cells depending on the border side. - **Setting CellRange Style**: Setting a cell formatting property on a `CellRange` is propagated to each cell within that range. ### Modifying Multiple Cells - **Preferable Method**: To modify the formatting property of multiple cells, obtain the `CellRange` to which all cells belong and use its `Style` property for modifications. - **Modifying Multiple Properties**: If modifying multiple formatting properties of a `CellRange` without preserving unmodified properties, it is preferable to create a new `CellStyle` instance, make the desired modifications, and then assign it to the `Style` property of the range. ### Internal Optimizations GemBox.Spreadsheet internally optimizes cell formatting to reduce memory footprint by avoiding unnecessary cell allocations when formatting ranges and caching formatting information for equally formatted cells. ``` -------------------------------- ### Get Drawing Width (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.FormattedExcelDrawing Gets the width of the drawing in Points. This property provides the horizontal dimension of the drawing. ```csharp public double Width { get; } ``` -------------------------------- ### Enable WPF Compatibility Switch on Windows Server (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/supported-platforms Enables the WPF compatibility switch for applications running on Windows Server, specifically for saving to XPS or image formats in ASP.NET Core applications. This is achieved by setting a switch using the AppContext class. ```vbnet Public Class Startup Public Sub New(configuration As IConfiguration) Configuration = configuration ' Add compatibility switch. AppContext.SetSwitch("Switch.System.Windows.Media.ShouldRenderEvenWhenNoDisplayDevicesAreAvailable", True) End Sub Public ReadOnly Property Configuration As IConfiguration ' ... End Class ``` -------------------------------- ### Get Drawing Height (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.FormattedExcelDrawing Gets the height of the drawing in Points. This property provides the vertical dimension of the drawing. ```csharp public double Height { get; } ``` -------------------------------- ### Load Spreadsheet from File (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Loads a spreadsheet from a file path in VB.NET. The file extension dictates the loading mechanism. It supports multiple file formats including Excel, OpenDocument, CSV, and HTML. ```vbnet Public Function Load(path As String) As ExcelFile ``` -------------------------------- ### Value Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellRange Gets or sets the cell value on one or more Excel cells. Property get is only meaningful for merged ranges. ```APIDOC ## GET/PUT /websites/gemboxsoftware_spreadsheet/Value ### Description Gets or sets the cell value on one or more Excel cells. Property get is only meaningful for merged ranges. ### Method GET, PUT ### Endpoint /websites/gemboxsoftware_spreadsheet/Value ### Request Body (for PUT) - **Object** (Object) - Required - The value to set for the cell(s). ### Response #### Success Response (200) - **Object** (Object) - The value of the merged cell range. ### Overrides AbstractRange.Value ### Remarks Property set will set the value of multiple cells or of a merged range. Property get has meaning only if the range is Merged; otherwise, an exception is thrown. ### Exceptions - **System.InvalidOperationException**: Property get is attempted on a cell range which is not merged. ### See Also - Merged ``` -------------------------------- ### RichValue Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellRange Gets or sets the rich value on one or more Excel cells. Property get is only meaningful for merged ranges. ```APIDOC ## GET/PUT /websites/gemboxsoftware_spreadsheet/RichValue ### Description Gets or sets the rich value on one or more Excel cells. Property get is only meaningful for merged ranges. ### Method GET, PUT ### Endpoint /websites/gemboxsoftware_spreadsheet/RichValue ### Request Body (for PUT) - **RichValueBase** (RichValueBase) - Required - The rich value to set. ### Response #### Success Response (200) - **RichValueBase** (RichValueBase) - The rich value of the merged cell range. ### Overrides AbstractRange.RichValue ### Remarks Property set will set the rich value of multiple cells or of a merged range. Property get has meaning only if the range is Merged; otherwise, an exception is thrown. ### Exceptions - **System.InvalidOperationException**: Property get is attempted on a cell range which is not merged. ### See Also - Merged ``` -------------------------------- ### Load Spreadsheet from File Path with Options Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelFile Loads a spreadsheet from a file using a specified path and LoadOptions. This allows for custom settings during the loading process. Available in C# and VB.NET. ```C# public static ExcelFile Load(string path, LoadOptions options) ``` ```VB.NET Public Shared Function Load(path As String, options As LoadOptions) As ExcelFile ``` -------------------------------- ### Enable WPF Compatibility Switch via runtimeconfig.template.json Source: https://www.gemboxsoftware.com/spreadsheet/docs/supported-platforms Enables the WPF compatibility switch by adding a runtimeconfig.template.json file to the project. This method is an alternative to using the AppContext class directly in C# or VB.NET code. ```json { "configProperties": { "Switch.System.Windows.Media.ShouldRenderEvenWhenNoDisplayDevicesAreAvailable": true } } ``` -------------------------------- ### Get Digital Signatures Options (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.XlsxSaveOptions Gets the collection of digital signature options for XLSX files in VB.NET. This property is read-only. ```vbnet Public ReadOnly Property DigitalSignatures As IList(Of XlsxDigitalSignatureSaveOptions) ``` -------------------------------- ### Get Digital Signatures Options (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.XlsxSaveOptions Gets the collection of digital signature options for XLSX files in C#. This property is read-only. ```csharp public IList DigitalSignatures { get; } ``` -------------------------------- ### XlsLoadOptions Constructor (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.XlsLoadOptions Initializes a new instance of the XlsLoadOptions class in C#. ```csharp public XlsLoadOptions() ``` -------------------------------- ### HtmlSaveOptions Constructor Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.HtmlSaveOptions Initializes a new instance of the HtmlSaveOptions class. ```APIDOC ## HtmlSaveOptions() ### Description Initializes a new instance of the HtmlSaveOptions class. ### Method Constructor ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get Worksheet Type (C#, VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelWorksheet Gets the type of the worksheet. This property is read-only and returns a SheetType enumeration value. ```C# public SheetType Type { get; } ``` ```VB.NET Public ReadOnly Property Type As SheetType ``` -------------------------------- ### Load Spreadsheet from File (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ComHelper Loads a spreadsheet from a file specified by its path. The file extension determines the loading options. Supports various formats like .xlsx, .ods, .csv, and .html. ```csharp public ExcelFile Load(string path) ``` -------------------------------- ### Set and Get Column Width (C# and VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelColumn Demonstrates how to get or set the width of a column. The width is represented as an integer. ```csharp public int Width { get; set; } ``` ```vbnet Public Property Width As Integer ``` -------------------------------- ### Set Start Page Number (C#, VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelPrintOptions Specifies the starting page number for printing. The default value is 1. ```C# public int StartPageNumber { get; set; } ``` ```VB.NET Public Property StartPageNumber As Integer ``` -------------------------------- ### PaginatorOptions Constructor (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.PaginatorOptions Initializes a new instance of the PaginatorOptions class in C#. This constructor does not require any arguments. ```csharp public PaginatorOptions() ``` -------------------------------- ### Get Drawing Width (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.FormattedExcelDrawing Gets the width of the drawing in Points using Visual Basic .NET. The return type is System.Double. ```vbnet Public ReadOnly Property Width As Double ``` -------------------------------- ### Initialize ExcelFile Class (C# and VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelFile Initializes an empty ExcelFile instance with no worksheets. To add worksheets, use the Worksheets property or Add methods. To load or save files, use the static Load and Save methods. ```csharp public ExcelFile() ``` ```vbnet Public Sub New ``` -------------------------------- ### Get Drawing Height (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.FormattedExcelDrawing Gets the height of the drawing in Points using Visual Basic .NET. The return type is System.Double. ```vbnet Public ReadOnly Property Height As Double ``` -------------------------------- ### Exceptions Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellStyle Details potential exceptions that may be thrown during cell formatting operations. ```APIDOC ## Exceptions ### Description This section lists exceptions that might occur when working with cell formatting. ### System.ArgumentOutOfRangeException * **Condition**: Value must be greater than or equal to 0. * **Context**: This exception is typically thrown when a property value is outside the acceptable range, often related to numeric formatting or indexing. ``` -------------------------------- ### Get Chart Series (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Charts.RadarChart Gets the collection of series for the RadarChart. This property provides access to all data series plotted on the radar chart. ```csharp public RadarChartSeriesCollection Series { get; } ``` -------------------------------- ### Enable WPF Compatibility Switch on Windows Server (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/supported-platforms Enables the WPF compatibility switch for applications running on Windows Server, specifically for saving to XPS or image formats in ASP.NET Core applications. This is achieved by setting a switch using the AppContext class. ```csharp public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; // Add compatibility switch. AppContext.SetSwitch("Switch.System.Windows.Media.ShouldRenderEvenWhenNoDisplayDevicesAreAvailable", true); } public IConfiguration Configuration { get; } // ... } ``` -------------------------------- ### PivotTable Class Overview Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.PivotTables.PivotTable Provides an overview of the PivotTable class, its namespace, assembly, and a brief description of its purpose in data manipulation. ```APIDOC ## PivotTable Class ### Namespace GemBox.Spreadsheet.PivotTables ### Assembly GemBox.Spreadsheet.dll ### Description Represents a pivot table, used to arrange and aggregate complicated data and drill down on details. Supports data from WorksheetSource, External sources, and other sources like multiple consolidation ranges or other Pivot Tables. Currently, GemBox.Spreadsheet supports creating only WorksheetSource, while others are supported via preservation. ### Remarks Pivot Tables work with a cache of the data source, represented by the `PivotCache` type. This cache stores an in-memory copy of the data source scheme and data, enabling efficient access and sharing among multiple Pivot Tables. The cache can be refreshed from the data source automatically or on demand using the `Refresh()` method. Pivot Tables are created using the `Add(PivotCache, String, String)` method and contain `PivotFields` which can be added to different areas: Report Filter Area (`PageFields`), Row Axis (`RowFields`), Column Axis (`ColumnFields`), and Values Area (`DataFields`). Both non-calculated and calculated PivotFields and PivotItems are supported. Calculated PivotFields are added using `AddCalculated(String, String)` and removed using `RemoveCalculated(String)`, and are always placed in the Values Area. Calculated PivotItems are managed similarly. Modifications to calculated PivotFields affect all PivotTables referencing the same PivotCache, as these changes are made in the PivotCache and propagated. Fields and items can be re-ordered using the `Move(Int32, Int32)` method. The `Calculate()` method updates the worksheet cells using values from the PivotCache. If the cache is empty or outdated, `Refresh()` must be called first. ``` -------------------------------- ### Get Picture Stream for Excel Picture (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelPicture Gets the picture data as a MemoryStream, allowing for direct access and manipulation of the image data. ```vbnet Public ReadOnly Property PictureStream As MemoryStream ``` -------------------------------- ### Initialize XlsxLoadOptions (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.XlsxLoadOptions Initializes a new instance of the XlsxLoadOptions class in C#. This constructor does not take any arguments. ```csharp public XlsxLoadOptions() ``` -------------------------------- ### Get Picture Stream for Excel Picture (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelPicture Gets the picture data as a MemoryStream, allowing for direct access and manipulation of the image data. ```csharp public MemoryStream PictureStream { get; } ``` -------------------------------- ### Get Picture Format for Excel Picture (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelPicture Gets the picture format object, providing access to specific picture-related properties and settings. ```vbnet Public ReadOnly Property PictureFormat As ExcelPictureFormat ``` -------------------------------- ### TableRow Class Overview Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Tables.TableRow Details about the TableRow class, its namespace, and assembly. ```APIDOC ## TableRow Class ### Description Represents a Table row. Supported in XLSX only. ### Namespace GemBox.Spreadsheet.Tables ### Assembly GemBox.Spreadsheet.dll ### C# Signature ```csharp public sealed class TableRow ``` ### VB.NET Signature ```vb Public NotInheritable Class TableRow ``` ``` -------------------------------- ### Constructors Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.WinFormsUtilities.ImportFromDataGridViewOptions Initializes an instance of the ImportFromDataGridViewOptions class. ```APIDOC ## Constructors ### ImportFromDataGridViewOptions() Initializes an instance of ImportFromDataGridViewOptions class. ### ImportFromDataGridViewOptions(Int32, Int32) Initializes an instance of ImportFromDataGridViewOptions class. #### Parameters - **startRow** (System.Int32) - Index of the first row of imported data in ExcelWorksheet. - **startColumn** (System.Int32) - Index of the first column of imported data in ExcelWorksheet. ### ImportFromDataGridViewOptions(String) Initializes an instance of ImportFromDataGridViewOptions class. #### Parameters - **startCell** (System.String) - Name of the first (top left) cell of imported data in ExcelWorksheet. ``` -------------------------------- ### Get Picture Format for Excel Picture (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelPicture Gets the picture format object, providing access to specific picture-related properties and settings. ```csharp public ExcelPictureFormat PictureFormat { get; } ``` -------------------------------- ### Get or Set Text Property (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Drawing.TextField Gets or sets the text content of a TextField instance in VB.NET. This property holds the string value of the text field. ```vbnet Public Property Text As String ``` -------------------------------- ### Length Methods Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Drawing.Length Documentation for the methods available on the Length struct, including CompareTo, Equals, From, GetHashCode, and To. ```APIDOC ## Methods ### CompareTo(Length) #### Description Compares the value of this instance to a specified Length value and returns an integer that indicates whether this instance is less than, equal to, or greater than the specified Length value. #### Parameters - **other** (Length) - Required - The object to compare to the current instance. #### Returns System.Int32 - A signed number indicating the relative values of this instance and the `other` parameter. If returned value is less than zero, then this instance is less than `other`; else, if it is zero, then this instance is equal to `other`; else (if it is greater than zero) this instance is greater than `other`. ### Equals(Length) #### Description Determines whether the `other` Length is equal to this Length instance. #### Parameters - **other** (Length) - Required - The other length to compare with this length instance. #### Returns System.Boolean - true if the `other` Length is equal to this Length instance; otherwise, false. ### Equals(Object) #### Description Determines whether the specified System.Object is equal to this Length instance. #### Parameters - **obj** (System.Object) - Required - The System.Object to compare with this length instance. #### Returns System.Boolean - true if the specified System.Object is a Length and is equal to this Length instance; otherwise, false. #### Overrides System.ValueType.Equals(System.Object) ### From(Double, LengthUnit) #### Description Converts a length value in a specified measurement unit to a Length instance. #### Parameters - **value** (System.Double) - Required - The length value. - **unit** (LengthUnit) - Required - The measurement unit. #### Returns Length - A Length instance that is equivalent to a specified input length in a specified measurement unit. ### GetHashCode() #### Description Returns a hash code for this Length instance. #### Returns System.Int32 - An integer value that specifies a hash value for this Length instance. #### Overrides System.ValueType.GetHashCode() ### To(LengthUnit) #### Description Converts this Length instance to a length value in a specified measurement unit. #### Parameters - **unit** (LengthUnit) - Required - The measurement unit. #### Returns System.Double - A length value that is equivalent to this Length instance in a specified measurement unit. ``` -------------------------------- ### CellRange Formatting Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellStyle Explains how to efficiently apply formatting to multiple cells using CellRange. ```APIDOC ## CellRange Formatting ### Description For performance reasons, cell formatting on a `CellRange` is resolved based on its top-left cell's formatting, except for borders, which are resolved based on corner cells depending on the border side. Setting a cell formatting property on a `CellRange` propagates to each cell within that range. ### Method N/A (This describes a behavior and preferred usage pattern) ### Endpoint N/A ### Parameters None ### Request Example ```csharp // C# Example: Applying a style to a range CellRange range = worksheet.Cells.GetSubrange("A1:C5"); range.Style = new CellStyle() { Font = new ExcelFont() { Name = "Times New Roman", Size = 14 } }; ``` ```vb.net ' VB.NET Example: Applying a style to a range Dim range As CellRange = worksheet.Cells.GetSubrange("A1:C5") range.Style = New CellStyle() With { .Font = New ExcelFont() With { .Name = "Times New Roman", .Size = 14 } } ``` ### Response N/A (This describes a behavior and preferred usage pattern) ``` -------------------------------- ### Get or Set Text Property (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.Drawing.TextField Gets or sets the text content of a TextField instance in C#. This property holds the string value of the text field. ```csharp public string Text { get; set; } ``` -------------------------------- ### Get Additional Certificates for Signature (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.XlsxDigitalSignatureSaveOptions Gets a list of additional certificates to be embedded within the digital signature. This property is saved to the document only when IsAdvancedElectronicSignature is true. ```csharp public IList Certificates { get; } ``` -------------------------------- ### Cell Formatting Concepts Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellStyle Explains the different groups of cell formatting and their associated properties. ```APIDOC ## Cell Formatting Concepts ### Description Cell formatting in GemBox.Spreadsheet is conceptually divided into several groups, each controlling specific aspects of cell appearance. ### Formatting Groups * **Number**: Controls how numeric values are formatted and rendered. Associated property: `NumberFormat`. * **Alignment**: Pertains to text alignment within cells. Associated properties: `HorizontalAlignment`, `VerticalAlignment`, `Indent`, `Rotation`, `IsTextVertical`, `WrapText`, `ShrinkToFit`. * **Font**: Defines the properties of the font used in the cell. Associated property: `Font`. * **Border**: Specifies cell border formats (left, right, top, bottom, diagonal). Associated property: `Borders`. * **Fill**: Defines fill formatting, including patterns or gradients. Associated property: `FillPattern`. * **Protection**: Contains protection properties for the cell. Associated properties: `Locked`, `FormulaHidden`. ### Additional CellStyle Properties * **Name**: The name of the referenced Style. * **QuotePrefix**: If true, stores numeric values as text; otherwise, false. * **IsDefault**: Indicates if the `Name` Style is the default (**Normal**) and has no additional modifications. Returns true if so, otherwise false. ``` -------------------------------- ### Get Workbook Styles Collection (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelFile Gets the collection of workbook (master) Styles defined for this ExcelFile instance. The returned value is of type CellStyleCollection. ```vbnet Public ReadOnly Property Styles As CellStyleCollection ``` -------------------------------- ### Cell Formatting Concepts Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.CellStyle Explains the different groups of cell formatting and their associated properties. ```APIDOC ## Cell Formatting Groups ### Description Cell formatting in GemBox.Spreadsheet is conceptually divided into several groups, each controlling specific aspects of cell appearance. ### Number - **Description**: Indicates how to format and render the numeric value of a cell. - **Associated Property**: `NumberFormat` ### Alignment - **Description**: Formatting information pertaining to text alignment in cells. - **Associated Properties**: `HorizontalAlignment`, `VerticalAlignment`, `Indent`, `Rotation`, `IsTextVertical`, `WrapText`, `ShrinkToFit` ### Font - **Description**: Defines the properties for the used font. - **Associated Property**: `Font` ### Border - **Description**: Expresses a single set of cell border formats (left, right, top, bottom and diagonal). - **Associated Property**: `Borders` ### Fill - **Description**: Specifies fill formatting (pattern or gradient). - **Associated Property**: `FillPattern` ### Protection - **Description**: Contains protection properties associated with the cell. - **Associated Properties**: `Locked`, `FormulaHidden` ## Additional CellStyle Properties ### Description These properties are part of CellStyle but not directly associated with the main formatting groups. - **Name** (string): Name of the referenced Style. - **QuotePrefix** (boolean): `true` to store numeric value of a cell as text; otherwise, `false`. - **IsDefault** (boolean): `true` if Name Style is default (**Normal**) and there are no additional modifications of cell formatting; otherwise, `false`. ``` -------------------------------- ### Get Workbook Styles Collection (C#) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.ExcelFile Gets the collection of workbook (master) Styles defined for this ExcelFile instance. The returned value is of type CellStyleCollection. ```csharp public CellStyleCollection Styles { get; } ``` -------------------------------- ### Initialize XlsxLoadOptions (VB.NET) Source: https://www.gemboxsoftware.com/spreadsheet/docs/GemBox.Spreadsheet.XlsxLoadOptions Initializes a new instance of the XlsxLoadOptions class in VB.NET. This constructor does not take any arguments. ```vbnet Public Sub New End Sub ```