ODSファイルをODF 1.1および1.2の仕様に保存
Contents
[
Hide
]
Aspose.Cells for Python via .NETは、ODF(OpenDocument Format)1.1および1.2の仕様に従ってODSファイル(OpenDocument Spreadsheet)を保存することをサポートします。
以下のサンプルコードでは、ワークブックオブジェクトを作成し、最初のワークシートのセルA1にいくつかの値を追加し、ODF 1.1および1.2の仕様でODSファイルを保存します。デフォルトでは、ODSファイルはODF 1.2の仕様で保存されます。
This file contains 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) |