Formatear Segmentador con Node.js a través de C++

Escenarios de uso posibles

Puedes formatear el segmentador en Microsoft Excel configurando su número de columnas o su estilo, etc. Aspose.Cells for Node.js via C++ también permite hacer esto usando las propiedades Slicer.getNumberOfColumns() y Slicer.getStyleType().

** Formatear rebanador**

Consulte el siguiente código, carga el archivo Excel de muestra que contiene un filtro. Accede al filtro, ajusta su número de columnas, tipo de estilo y lo guarda como archivo Excel de salida. La captura de pantalla muestra cómo se ve el filtro después de la ejecución del código de ejemplo.

todo:image_alt_text

Código de muestra

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

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sampleFormattingSlicer.xlsx");
// Load sample Excel file containing slicer.
const wb = new AsposeCells.Workbook(filePath);

// Access first worksheet.
const ws = wb.getWorksheets().get(0);

// Access the first slicer inside the slicer collection.
const slicer = ws.getSlicers().get(0);

// Set the number of columns of the slicer.
slicer.setNumberOfColumns(2);

// Set the type of slicer style.
slicer.setStyleType(AsposeCells.SlicerStyleType.SlicerStyleLight6);

// Save the workbook in output XLSX format.
wb.save("outputFormattingSlicer.xlsx", AsposeCells.SaveFormat.Xlsx);