Come controllare la barra delle schede del foglio con Node.js tramite C++
Contents
[
Hide
]
Possibili Scenari di Utilizzo
Quando hai bisogno di regolare la visualizzazione della barra del foglio Excel, devi sapere come controllare la barra delle schede del foglio, come nasconderla o mostrarla, cambiare la larghezza della barra delle schede, specificare la prima scheda visibile, e così via. Aspose.Cells for Node.js via C++ supporta queste funzionalità. Aspose.Cells fornisce le seguenti proprietà e metodi per aiutarti a raggiungere i tuoi obiettivi.
- WorkbookSettings.getShowTabs()
- WorkbookSettings.getSheetTabBarWidth()
- WorkbookSettings.getFirstVisibleTab()
Come controllare la barra delle schede del foglio usando Aspose.Cells for Node.js via C++
Questo esempio mostra come:
- Crea un libro di lavoro.
- Aggiungi dati alle celle nel primo foglio di lavoro.
- Visualizzare la scheda del foglio e impostare la larghezza della barra delle schede.
const AsposeCells = require("aspose.cells.node");
const path = require("path");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Loads the workbook which contains hidden external links
const workbook = new AsposeCells.Workbook();
// Obtaining the reference of the newly added worksheet
const ws = workbook.getWorksheets().get(0);
const cells = ws.getCells();
// Setting the value to the cells
let cell = cells.get("A1");
cell.putValue("Fruit");
cell = cells.get("B1");
cell.putValue("Count");
cell = cells.get("C1");
cell.putValue("Price");
cell = cells.get("A2");
cell.putValue("Apple");
cell = cells.get("A3");
cell.putValue("Mango");
cell = cells.get("A4");
cell.putValue("Blackberry");
cell = cells.get("A5");
cell.putValue("Cherry");
// Display the sheet tab and set the width of the tab bar
workbook.getSettings().setShowTabs(true);
workbook.getSettings().setSheetTabBarWidth(150);
workbook.save("out.xlsx");
Anteprima del file di risultato: