Enum SaveFormat

SaveFormat enumeration

Represents the format in which the workbook is saved.

public enum SaveFormat

Values

NameValueDescription
Csv1Comma-Separated Values(CSV) text file.
CSV1Comma-Separated Values(CSV) text file. NOTE: This member is now obsolete. Instead, please use Csv property. This property will be removed 6 months later since April 2021. Aspose apologizes for any inconvenience you may have experienced.
Xlsx6Represents an xlsx file.
Xlsm7Represents an xlsm file which enable macros.
Xltx8Represents an xltx file.
Xltm9Represents an xltm file which enable macros.
Xlam10Represents an xltm file which enable addin macros.
Tsv11Tab-Separated Values(TSV) text file.
TSV11Tab-Separated Values(TSV) text file. NOTE: This member is now obsolete. Instead, please use Tsv property. This property will be removed 6 months later since April 2021. Aspose apologizes for any inconvenience you may have experienced.
TabDelimited11Represents a tab delimited text file, same with Tsv.
Html12Represents a html file.
MHtml17Represents a mhtml file.
Ods14Open Document Sheet(ODS) file.
ODS14Open Document Sheet(ODS) file. NOTE: This member is now obsolete. Instead, please use Ods property. This property will be removed 6 months later since April 2021. Aspose apologizes for any inconvenience you may have experienced.
Excel97To20035Represents an Excel97-2003 xls file.
SpreadsheetML15Represents an Excel 2003 xml file.
Xlsb16Represents an xlsb file.
Auto0If saving the file to the disk,the file format accords to the extension of the file name. If saving the file to the stream, the file format is xlsx.
Unknown255Represents unrecognized format, cannot be saved.
Pdf13Represents a Pdf file.
Xps20XPS (XML Paper Specification) format.
XPS20XPS (XML Paper Specification) format. NOTE: This member is now obsolete. Instead, please use Xps property. This property will be removed 6 months later since April 2021. Aspose apologizes for any inconvenience you may have experienced.
Tiff21Represents a TIFF file.
TIFF21Represents a TIFF file. NOTE: This member is now obsolete. Instead, please use Tiff property. This property will be removed 6 months later since April 2021. Aspose apologizes for any inconvenience you may have experienced.
Svg28SVG file.
SVG28SVG file. NOTE: This member is now obsolete. Instead, please use Svg property. This property will be removed 6 months later since April 2021. Aspose apologizes for any inconvenience you may have experienced.
Dif30Data Interchange Format.
Ots31Open Document Template Sheet(OTS) file.
Xlt32Excel 97-2003 template file.
Xml51Represents a simple xml file.
Numbers56Represents a numbers file.
Markdown57Represents markdown document.
Fods59Represents OpenDocument Flat XML Spreadsheet (.fods) file format.
FODS59Represents OpenDocument Flat XML Spreadsheet (.fods) file format. NOTE: This member is now obsolete. Instead, please use Fods property. This property will be removed 6 months later since April 2021. Aspose apologizes for any inconvenience you may have experienced.
Sxc60Represents StarOffice Calc Spreadsheet (.sxc) file format.
SXC60Represents StarOffice Calc Spreadsheet (.sxc) file format. NOTE: This member is now obsolete. Instead, please use Sxc property. This property will be removed 6 months later since April 2021. Aspose apologizes for any inconvenience you may have experienced.
Pptx61Represents .pptx file.
Docx62Represents .docx file.
Emf258Windows Enhanced Metafile.
Jpg261JPEG JFIF.
Png262Portable Network Graphics.
Bmp263Windows Bitmap
Gif322Gif
Json513Json
SqlScript514Sql
XHtml771Rrepesents XHtml file.
Epub772Represents Epub file.
Azw3773Represents Azw3 file.
Pcl1025PCL (Printer Command Language)

Examples

[C#]

using Aspose.Cells;
using System;

namespace Demos
{
    public class SaveFormatDemo
    {
        public static void SaveFormatExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();

            // Add a new worksheet to the workbook
            Worksheet worksheet = workbook.Worksheets[0];

            // Add sample data to the worksheet
            worksheet.Cells["A1"].PutValue("Name");
            worksheet.Cells["A2"].PutValue("John");
            worksheet.Cells["A3"].PutValue("Jane");
            worksheet.Cells["A4"].PutValue("Doe");

            worksheet.Cells["B1"].PutValue("Age");
            worksheet.Cells["B2"].PutValue(30);
            worksheet.Cells["B3"].PutValue(25);
            worksheet.Cells["B4"].PutValue(35);

            // Save the workbook in different formats
            workbook.Save("SaveFormatExample.xlsx", SaveFormat.Xlsx);
            workbook.Save("SaveFormatExample.xls", SaveFormat.Excel97To2003);
            workbook.Save("SaveFormatExample.csv", SaveFormat.Csv);
            workbook.Save("SaveFormatExample.pdf", SaveFormat.Pdf);
            workbook.Save("SaveFormatExample.html", SaveFormat.Html);

            // Output the results
            Console.WriteLine("Workbook saved in multiple formats.");
        }
    }
}

See Also