Salva il file ODS nelle specifiche ODF 1.1 e 1.2
Contents
[
Hide
]
Aspose.Cells supporta il salvataggio di un file ODS (Foglio di calcolo OpenDocument) nell’ODF (Formato OpenDocument ) Specifiche 1.1 e 1.2. Aspose.Cells haOdsSaveOptions.IsStrictSchema11 proprietà che specifica l’uso della specifica ODF 1.1 per il salvataggio dei file ODS. Il valore predefinito di questa proprietà èfalso, quindi il file ODS salvato senza questa impostazione utilizza le specifiche 1.2.
Il codice di esempio riportato di seguito crea un oggetto cartella di lavoro, aggiunge un valore alla cella A1 nel primo foglio di lavoro e quindi salva il file ODS nelle specifiche ODF 1.1 e 1.2. Per impostazione predefinita, il file ODS viene salvato nella specifica 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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create workbook | |
Workbook workbook = new Workbook(); | |
// Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Put some value in cell A1 | |
Cell cell = worksheet.Cells["A1"]; | |
cell.PutValue("Welcome to Aspose!"); | |
// Save ODS in ODF 1.2 version which is default | |
OdsSaveOptions options = new OdsSaveOptions(); | |
workbook.Save(dataDir + "ODF1.2_out.ods", options); | |
// Save ODS in ODF 1.1 version | |
options.OdfStrictVersion = Aspose.Cells.Ods.OpenDocumentFormatVersionType.Odf11; | |
workbook.Save(dataDir + "ODF1.1_out.ods", options); | |
// Save ODS in ODF 1.3 version | |
options.OdfStrictVersion = Aspose.Cells.Ods.OpenDocumentFormatVersionType.Odf13; | |
workbook.Save(dataDir + "ODF1.3_out.ods", options); |