Получить объекты наборов значков, панелей данных или цветовых шкал, используемых при условном форматировании

Contents
[ ]

Следующий пример кода показывает, как считать используемые для условного форматирования наборы значков. С помощью простого API Aspose.Cells данные изображения набора значков сохраняются как изображение.

const AsposeCells = require("aspose.cells.node");
const path = require("path");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Open a template Excel file
const workbook = new AsposeCells.Workbook(path.join(dataDir, "book1.xlsx"));
// Get the first worksheet in the workbook
const sheet = workbook.getWorksheets().get(0);
// Get the A1 cell
const cell = sheet.getCells().get("A1");
// Get the conditional formatting result object
const cfr = cell.getConditionalFormattingResult();
// Get the icon set
const icon = cfr.getConditionalFormattingIcon();
// Create the image file based on the icon's image data
require("fs").writeFileSync(path.join(dataDir, "imgIcon.out.jpg"), icon.getImageData());