Save ODS File in ODF 1.1 and 1.2 Specifications
Contents
[
Hide
]
Aspose.Cells for Python via .NET supports saving an ODS file (OpenDocument Spreadsheet) in the ODF (OpenDocument Format) 1.1 and 1.2 specifications. Aspose.Cells for Python via .NET has OdsSaveOptions.is_strict_schema11 property that specifies the use of ODF 1.1 specification for saving ODS files. The default value of this property is false, so the ODS file saved without this setting uses the 1.2 specifications.
The sample code below creates a workbook object, adds some value to cell A1 on the first worksheet and then saves the ODS file in ODF 1.1 and 1.2 specifications. By default, the ODS file is saved in ODF 1.2 specification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.cells import OdsSaveOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Create workbook | |
workbook = Workbook() | |
# Access first worksheet | |
worksheet = workbook.worksheets[0] | |
# Put some value in cell A1 | |
cell = worksheet.cells.get("A1") | |
cell.put_value("Welcome to Aspose!") | |
# Save ODS in ODF 1.2 version which is default | |
options = OdsSaveOptions() | |
workbook.save(dataDir + "ODF1.2_out.ods", options) | |
# Save ODS in ODF 1.1 version | |
options.is_strict_schema11 = True | |
workbook.save(dataDir + "ODF1.1_out.ods", options) |