ContentTypeProperties ile Çalışma
Contents
[
Hide
]
Aspose.Cells sağlarWorkbook.ContentTypeProperties.Add bir excel dosyasına özel ContentTypeProperties ekleme yöntemi. ayarlayarak özelliği isteğe bağlı hale de getirebilirsiniz.ContentTypeProperty.IsNillaable mülkiyetdoğru. Aşağıdaki kod parçacığı, bir excel dosyasına isteğe bağlı özel ContentTypeProperties eklemeyi gösterir. Aşağıdaki görüntü, örnek kod tarafından eklenen her iki özelliği de göstermektedir.
Örnek kod tarafından oluşturulan çıktı dosyası başvuru için eklenmiştir.
Basit kod
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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//source directory | |
string outputDir = RunExamples.Get_OutputDirectory(); | |
Workbook workbook = new Workbook(FileFormatType.Xlsx); | |
int index = workbook.ContentTypeProperties.Add("MK31", "Simple Data"); | |
workbook.ContentTypeProperties[index].IsNillable = false; | |
index = workbook.ContentTypeProperties.Add("MK32", DateTime.Now.ToString("yyyy-MM-dd'T'hh:mm:ss"), "DateTime"); | |
workbook.ContentTypeProperties[index].IsNillable = true; | |
workbook.Save(outputDir + "WorkingWithContentTypeProperties_out.xlsx"); |