
Aspose.Cells do JavaScript trí C++
Leabharlann JavaScript chun Bileog Oibre Excel a Chruthú & a Thiontú go PDF
Ligeann Aspose.Cells do JavaScript trí C++ d'fhorbróirí bogearraí Cruthú, Eagarthóireacht, Láimhseáil agus Tiontú Leabharlann Excel go formáidí XLS, XLSX, XLSB, XLSM, ODS, CSV, agus HTML.
Cad é Aspose.Cells le haghaidh JavaScript trí C++?
Is leabharlann cumhachtach, ard-fheidhmeach é Aspose.Cells for JavaScript trí C++ a chuireann ar chumas forbróirí bogearraí comhaid Excel a chruthú, a láimhseáil, a thiontú, agus a rindreáil go díreach i dtimpeallachtaí brabhsálaí nó i bhfeidhmchláir Node.js. Tógtha ar theicneolaíocht WebAssembly, soláthraíonn an leabharlann seo feidhmíocht gar do dhúchasach gan Microsoft Excel nó aon spleáchais taobh freastalaí a éileamh. Cibé an bhfuil tú ag tógáil painéil léargas sonraí, uirlisí cruthú doiciméad, nó píblíneanna próiseála sonraí casta, cuireann an leabharlann réiteach cuimsitheach ar fáil do gach riachtanas de do bhileoga.
Is API saibhir gnéithe é Aspose.Cells for JavaScript via C++ a thugann feidhmiúlacht Excel leibhéal fiontraíochta do fheidhmchláir JavaScript. Tacaíonn sé le formáidí comhaid iolracha lena n-áirítear XLS, XLSX, XLSB, XLSM, ODS, CSV, TSV, SpreadsheetML, HTML agus cinn eile, rud a fhágann go bhfuil sé ina rogha ilúsáideach do riachtanais gnó éagsúil. Úsáideann an leabharlann WebAssembly chun feidhmíocht eisceachtúil a bhaint amach go díreach i mbrabhsálaithe gréasáin, ag baint an ghá le próiseáil freastalaí agus ag cumasú feidhmchláir ghréasáin fíor‑shearbhóireachta. Tá lorg ama rite ama éadrom an leabharlainne ag déanamh í oiriúnach do fheidhmchláir ghréasáin nua‑aimseartha áit a bhfuil feidhmíocht agus taithí an úsáideora ríthábhachtach. Níos mó ná réitigh traidisiúnta bunaithe ar fhreastalaí, próiseálann Aspose.Cells for JavaScript via C++ na scarbhileoga go hiomlán ar thaobh an chliaint, ag laghdú ualach an fhreastalaí agus ag feabhsú ama freagartha.
Ag tosú le Aspose.Cells le haghaidh JavaScript trí C++
Ní gá ach an clib scripte seo a leanas a chur leis an mbrabhsálaí chun tosú le Aspose.Cells for JavaScript via C++.
Aspose.Cells le haghaidh JavaScript trí C++ trí NPM
npm i aspose.cells.js Cruthú & Láimhseáil Comhad Excel trí JavaScript
Aspose.Cells do JavaScript trí leabharlann C++ soláthraíonn smacht iomlán ar chruthú agus modhnú leabhair oibre Excel laistigh de fheidhmchláir JavaScript. Tá an leabharlann an-éasca le láimhseáil agus cuireann sé ar chumas forbróirí bogearraí leabhair oibre nua a chruthú go cláir, bileoga oibre a chur leis, cealla a láimhseáil, agus sonraí a eagrú go héasca. Seo sampla an-úsáideach a léiríonn an próiseas bunúsach chun leabhar oibre Excel i bhformáid XSLX a chruthú ag baint úsáide as leabharlann JavaScript.
Conas leabharlann oibre Excel XLSX nua a chruthú trí Leabharlann JavaScript?
// Load the Aspose.Cells module
const aspose-cells = require("aspose-cells-cloud");
// Initialize the configuration and API instance (for cloud version) or use the on-premise API.
// Note: The following example demonstrates the conceptual structure. Actual initialization may vary.
const cellsApi = new aspose-cells.CellsApi(/* Your API Key and SID */);
// For the on-premise version, you would typically work with Workbook and Worksheet objects directly.
const aspose = require('aspose.cells'); // Hypothetical import for on-premise
// Create a new Workbook object
let workbook = new aspose.cells.Workbook();
// Access the first worksheet
let worksheet = workbook.getWorksheets().get(0);
// Access cell "A1" in the first worksheet
let cells = worksheet.getCells();
let cell = cells.get("A1");
// Set a value for the cell
cell.setValue("Hello, Aspose.Cells from Node.js!");
// Save the workbook
workbook.save("output/NewWorkbook.xlsx");
console.log("New workbook created successfully!");
Comhshóiriú Formáid Comhad Excel trí Leabharlann JavaScript
Ionann na gnéithe is cumhachtaí ná an cumas a thiontú idir formáidí comhaid éagsúla gan uaim. Tá sé seo thar a bheith úsáideach chun tuarascálacha a ghiniúint i bhformáidí éagsúla. Tá Aspose.Cells do JavaScript trí C++ soláthair feidhmiúlacht iomlán chun comhaid scarbhileog a luchtú agus a thiontú go formáidí comhaid eile mar Excel (XLS, XLSX, XLSB, XLSM), ODS, CSV, agus formáidí HTML. Léiríonn an sampla seo tiontú ó Excel go PDF. Léimid comhad Excel uaslódáilte mar ArrayBuffer, cruthaímid réad Workbook as, agus ansin sábháilimid é i bhformáid PDF.
Conas Comhad Excel XLSX a Thiontú go PDF trí Leabharlann JavaScript?
const { Workbook, SaveFormat } = AsposeCells;
AsposeCells.onReady({
license: "/lic/aspose.cells.enc",
fontPath: "/fonts/",
fontList: [
"arial.ttf",
"NotoSansSC-Regular.ttf"
]
}).then(() => {
console.log("Aspose.Cells initialized");
});
document.getElementById('runExample').addEventListener('click', async () => {
const fileInput = document.getElementById('fileInput');
const resultDiv = document.getElementById('result');
if (!fileInput.files.length) {
resultDiv.innerHTML = 'Roghnaigh comhad Excel le do thoil.
';
return;
}
const file = fileInput.files[0];
const arrayBuffer = await file.arrayBuffer();
// Instantiating a Workbook object by opening the Excel file through the file stream
const workbook = new Workbook(new Uint8Array(arrayBuffer));
// Save the document in PDF format
const outputData = workbook.save(SaveFormat.Pdf);
const blob = new Blob([outputData], { type: 'application/pdf' });
const downloadLink = document.getElementById('downloadLink');
downloadLink.href = URL.createObjectURL(blob);
downloadLink.download = 'output.pdf';
downloadLink.style.display = 'block';
downloadLink.textContent = 'Download PDF File';
resultDiv.innerHTML = 'Críochnú an tiontaithe go rathúil! Cliceáil an nasc íoslódála chun an comhad PDF a fháil.
';
});
Inneall Ríomh Foirmle trí JavaScript
Cuimsíonn Aspose.Cells do JavaScript trí C++ innill ríofa láimhseála foirmle cumhachtach a thacaíonn le foirmleanna casta Excel, lena n-áirítear feidhmeanna tógtha isteach, foirmleanna eagar, agus feidhmeanna sainmhínithe ag an úsáideoir. Tacaíonn an leabharlann le foirmleanna neadaithe casta agus láimhseálann sé tagairtí cealla agus spleáchais go huathoibríoch. Is féidir le forbróirí bogearraí feidhmeanna éagsúla Excel a úsáid go héasca, lena n-áirítear SUM, AVERAGE, MAX, MIN, IF, agus VLOOKUP. Sannann an modh setFormula() foirmleanna do chealla, agus luann calculateFormula() gach foirmle sa leabharmharc. Seo sampla simplí a thaispeánann cumais ríomhaireachta foirmle Aspose.Cells.
Conas Formhulaí éagsúla a chur i bhfeidhm agus a úsáid i leabhar oibre Excel trí Leabharlann JavaScript?
function demonstrateFormulas() {
const workbook = new Workbook();
const worksheet = workbook.getWorksheets().get(0);
const cells = worksheet.getCells();
// Add sample data
cells.get("A1").putValue("Sales Q1");
cells.get("A2").putValue(15000);
cells.get("A3").putValue(18000);
cells.get("A4").putValue(22000);
cells.get("A5").putValue(19500);
// SUM formula
cells.get("A6").setFormula("=SUM(A2:A5)");
// AVERAGE formula
cells.get("B1").putValue("Average");
cells.get("B2").setFormula("=AVERAGE(A2:A5)");
// MAX and MIN formulas
cells.get("C1").putValue("Maximum");
cells.get("C2").setFormula("=MAX(A2:A5)");
cells.get("D1").putValue("Minimum");
cells.get("D2").setFormula("=MIN(A2:A5)");
// Conditional formula with IF
cells.get("E1").putValue("Performance");
cells.get("E2").setFormula("=IF(B2>20000,\"Excellent\",IF(B2>15000,\"Good\",\"Needs Improvement\"))");
// VLOOKUP example
cells.get("G1").putValue("Product");
cells.get("H1").putValue("Price");
cells.get("G2").putValue("A");
cells.get("H2").putValue(100);
cells.get("G3").putValue("B");
cells.get("H3").putValue(200);
cells.get("J1").putValue("Lookup");
cells.get("J2").putValue("B");
cells.get("K1").putValue("Result");
cells.get("K2").setFormula("=VLOOKUP(J2,G2:H3,2,FALSE)");
// Calculate all formulas
workbook.calculateFormula();
return workbook;
}
Cruthaigh & Láimhseáil Cairtí trí Leabharlann JavaScript
Tá tacaíocht iomlán ar fáil ag Aspose.Cells do JavaScript trí C++ chun cairteacha agus graif gairmiúla a chruthú agus a bhainistiú chun do shonraí a léiriú go héifeachtach laistigh de fheidhmchláir JavaScript. Tacaíonn an leabharlann le gach cineál caighdeánach cairteacha Excel, lena n-áirítear colún, barra, líne, píosa, scaipthe, agus níos mó. Tá sé freisin an-éasca an chart a shaincheapadh trí theidil a shocrú don chart féin agus do na dá ais, agus lipéid sonraí a chumasú chun luachanna a thaispeáint ar na colúin. Cruthaíonn an sampla seo chart colúin chun sonraí díolacháin mhíosúla a léiriú ag baint úsáide as orduithe JavaScript.
Conas Cairt Cholúin a Chruthú i bhileog oibre Excel trí Leabharlann JavaScript?
function createChartExample() {
const workbook = new Workbook();
const worksheet = workbook.getWorksheets().get(0);
const cells = worksheet.getCells();
// Add chart data
cells.get("A1").putValue("Month");
cells.get("B1").putValue("Sales");
cells.get("A2").putValue("January");
cells.get("B2").putValue(25000);
cells.get("A3").putValue("February");
cells.get("B3").putValue(28000);
cells.get("A4").putValue("March");
cells.get("B4").putValue(32000);
cells.get("A5").putValue("April");
cells.get("B5").putValue(30000);
// Add a column chart
const chartIndex = worksheet.getCharts().add(
AsposeCells.ChartType.Column,
5, 0, 15, 5
);
const chart = worksheet.getCharts().get(chartIndex);
// Set chart data source
chart.setChartDataRange("A1:B5", true);
// Customize chart title
chart.getTitle().setText("Monthly Sales Report");
chart.getTitle().getFont().setBold(true);
chart.getTitle().getFont().setSize(14);
// Customize axis titles
chart.getCategoryAxis().getTitle().setText("Months");
chart.getValueAxis().getTitle().setText("Sales Amount ($)");
// Show data labels
chart.getNSeries().get(0).getDataLabels().setShowValue(true);
return workbook;
}
