تصفية نوع البيانات أثناء تحميل المصنف من ملف القالب

Contents
[ ]

يقوم نموذج التعليمات البرمجية التالي بتحميل كائنات الشكل فقط أثناء تحميل المصنف من ملفملف نموذجي والتي يمكنك تنزيلها من الرابط المحدد. تُظهر لقطة الشاشة التالية ملفملف نموذجيالمحتويات ويوضح أيضًا أن البيانات باللون الأحمر والخلفية الصفراء لن يتم تحميلها بسببLoadOptions.LoadFilterتم تعيين الخاصية علىLoadDataFilterOptions.Shape

ما يجب القيام به: image_بديل_نص

تُظهر لقطة الشاشة التالية ملفالإخراج PDF والتي يمكنك تنزيلها من الرابط المحدد. هنا يمكنك أن ترى ، البيانات باللون الأحمر والخلفية الصفراء غير موجودة ولكن جميع الأشكال موجودة.

ما يجب القيام به: image_بديل_نص

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Source directory
string sourceDir = RunExamples.Get_SourceDirectory();
//Output directory
string outputDir = RunExamples.Get_OutputDirectory();
// Set the load options, we only want to load shapes and do not want to load data
LoadOptions loadOptions = new LoadOptions(LoadFormat.Xlsx);
loadOptions.LoadFilter = new LoadFilter(LoadDataFilterOptions.All & ~LoadDataFilterOptions.Chart);
// Create workbook object from sample excel file using load options
Workbook workbook = new Workbook(sourceDir + "sampleFilterChars.xlsx", loadOptions);
// Save the output in pdf format
workbook.Save(outputDir + "sampleFilterChars_out.pdf", SaveFormat.Pdf);