Class DifSaveOptions

DifSaveOptions class

Represents the options of saving dif file.

public class DifSaveOptions : SaveOptions

Constructors

NameDescription
DifSaveOptions()Creates the options for saving DIF file.

Properties

NameDescription
CachedFileFolder { get; set; }The cached file folder is used to store some large data.(Inherited from SaveOptions.)
CheckExcelRestriction { get; set; }Whether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputting string value longer than 32K. When you input a value longer than 32K, it will be truncated.(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.)
MergeAreas { get; set; }Indicates whether merge the areas of conditional formatting and validation before saving the file.(Inherited from SaveOptions.)
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 System;

    public class DifSaveOptionsDemo
    {
        public static void DifSaveOptionsExample()
        {
            // Create a new Workbook object
            Workbook workbook = new Workbook();
            
            // Add some data to the worksheet for demonstration purposes
            Worksheet worksheet = workbook.Worksheets[0];
            worksheet.Cells[0, 0].PutValue("Sample Data");

            // Create an instance of DifSaveOptions
            DifSaveOptions saveOptions = new DifSaveOptions
            {
                // Set properties as per the JSON specification
                ClearData = true,
                CachedFileFolder = @"C:\Temp\CachedFiles",
                ValidateMergedAreas = true,
                MergeAreas = false,
                CreateDirectory = true,
                SortNames = true,
                SortExternalNames = false,
                RefreshChartCache = true,
                UpdateSmartArt = false
            };


            // Save the workbook with the DifSaveOptions
            workbook.Save("E:\\VSCellsForm\\DifSaveOptionsExample.dif", saveOptions);

            // Output to console to indicate the process is complete
            Console.WriteLine("Workbook saved successfully with DifSaveOptions.");
        }
    }
}

See Also