テンプレート ファイルからワークブックを読み込む際のデータの種類のフィルタリング

Contents
[ ]

次のサンプル コードは、ワークブックをテンプレートファイル指定されたリンクからダウンロードできます。次のスクリーンショットは、テンプレートファイルまた、赤と黄色の背景のデータはロードされないことも説明されています。LoadOptions.LoadFilterプロパティはに設定されていますLoadDataFilterOptions.Shape

todo:画像_代替_文章

次のスクリーンショットは、出力 PDF指定されたリンクからダウンロードできます。ここでわかるように、赤色と黄色の背景のデータは存在しませんが、すべての形状が存在します。

todo:画像_代替_文章

// 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);