Filtering the kind of data while loading the workbook from a template file with Node.js via C++

Contents
[ ]

The following sample code loads only shape objects while loading the workbook from the template file, which you can download from the given link. The next screenshot shows the contents of the template file and also explains that the data in red text and yellow background will not be loaded because the LoadOptions.getLoadFilter() property has been set to Shape.

todo:image_alt_text

The following screenshot shows the output PDF, which you can download from the given link. Here you can see that the data in red text and yellow background is not present, but all shapes are present.

todo:image_alt_text

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// Source directory
const sourceDir = path.join(__dirname, "data");

// Output directory
const outputDir = path.join(__dirname, "output");

// Set the load options; we only want to load shapes and do not want to load data
const loadOptions = new AsposeCells.LoadOptions(AsposeCells.LoadFormat.Xlsx);            

loadOptions.setLoadFilter(
    new AsposeCells.LoadFilter(
        AsposeCells.LoadDataFilterOptions.All & ~AsposeCells.LoadDataFilterOptions.Chart
    )
);

// Create a workbook object from the sample Excel file using load options
const workbook = new AsposeCells.Workbook(
    path.join(sourceDir, "sampleFilterChars.xlsx"),
    loadOptions
);

// Save the output in PDF format
workbook.save(outputDir + "sampleFilterChars_out.pdf", AsposeCells.SaveFormat.Pdf);