Class OdsSaveOptions

OdsSaveOptions class

Represents the options of saving ods file.

public class OdsSaveOptions : SaveOptions

Constructors

NameDescription
OdsSaveOptions()Creates the options of saving ods file.
OdsSaveOptions(SaveFormat)Creates the options of saving ods file.

Properties

NameDescription
CachedFileFolder { get; set; }The cached file folder is used to store some large data.(Inherited from SaveOptions.)
ClearData { get; set; }Make the workbook empty after saving the file.(Inherited from SaveOptions.)
CreateDirectory { get; set; }If true and the directory does not exist, the directory will be automatically created before saving the file.(Inherited from SaveOptions.)
EncryptDocumentProperties { get; set; }Indicates whether encrypt document properties when saving as .xls file. The default value is true.(Inherited from SaveOptions.)
GeneratorType { get; set; }Gets and sets the generator of the ods file.
IgnorePivotTables { get; set; }Indicates whether saving pivot tables.
IsStrictSchema11 { get; set; }(Obsolete.) Indicates whether the ods file should be saved as ODF format version 1.1. Default is false.
MergeAreas { get; set; }Indicates whether merge the areas of conditional formatting and validation before saving the file.(Inherited from SaveOptions.)
OdfStrictVersion { get; set; }Gets and sets the ODF version.
RefreshChartCache { get; set; }Indicates whether refreshing chart cache data(Inherited from SaveOptions.)
SaveFormat { get; }Gets the save file format.(Inherited from SaveOptions.)
SortExternalNames { get; set; }Indicates whether sorting external defined names before saving file.(Inherited from SaveOptions.)
SortNames { get; set; }Indicates whether sorting defined names before saving file.(Inherited from SaveOptions.)
UpdateSmartArt { get; set; }Indicates whether updating smart art setting. The default value is false.(Inherited from SaveOptions.)
ValidateMergedAreas { get; set; }Indicates whether validate merged cells before saving the file.(Inherited from SaveOptions.)
WarningCallback { get; set; }Gets or sets warning callback.(Inherited from SaveOptions.)

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Ods;
    using System;

    public class OdsSaveOptionsDemo
    {
        public static void OdsSaveOptionsExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            worksheet.Cells["A1"].PutValue("Hello World");

            // Create an instance of OdsSaveOptions
            OdsSaveOptions saveOptions = new OdsSaveOptions();

            // Setting properties
            saveOptions.GeneratorType = OdsGeneratorType.LibreOffice;
            saveOptions.IsStrictSchema11 = true;
            saveOptions.OdfStrictVersion = OpenDocumentFormatVersionType.Odf12;
            saveOptions.ClearData = false;
            saveOptions.CachedFileFolder = @"C:\Temp";
            saveOptions.ValidateMergedAreas = true;
            saveOptions.MergeAreas = true;
            saveOptions.SortNames = true;
            saveOptions.SortExternalNames = true;
            saveOptions.RefreshChartCache = true;
            saveOptions.UpdateSmartArt = false;

            // Save the workbook as ODS file with the specified options
            workbook.Save("OdsSaveOptionsExample.ods", saveOptions);

            return;
        }
    }
}

See Also