ODF 1.1 ve 1.2 Özelliklerinde ODS Dosyasını Kaydet
Contents
[
Hide
]
Aspose.Cells, ODS dosyasını (Açık Belge Elektronik Tablosu) ODF (Açık Belge Biçimi) 1.1 ve 1.2 özellikleriyle kaydetmeyi destekler. Aspose.Cells, ODS dosyalarını kaydetmek için ODF 1.1 özelliklerini kullanmayı belirten bir OdsSaveOptions.IsStrictSchema11 özelliğine sahiptir. Bu özelliğin varsayılan değeri false olduğundan, bu ayarlama olmadan kaydedilen ODS dosyası 1.2 özelliklerini kullanır.
Aşağıdaki örnek kod, bir çalışma kitabı nesnesi oluşturur, ilk çalışsayfaya birkaç değer ekler ve sonra ODF 1.1 ve 1.2 özelliklerinde ODS dosyasını kaydeder. Varsayılan olarak, ODS dosyası ODF 1.2 özelliğinde kaydedilir.
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); |