|
const { CellsApi, UploadFileRequest, Cells_GetWorksheetCellRequest } = require("asposecellscloud"); |
|
const clientId = process.env.CellsCloudClientId; |
|
const clientSecret = process.env.CellsCloudClientSecret; |
|
const ApiURL = process.env.CellsCloudApiBaseUrl; |
|
const fs = require('fs'); |
|
const path = require('path'); |
|
const cellsApi = new CellsApi(clientId, clientSecret,"v3.0",ApiURL); |
|
const localPath = "D:/aspose-cells-cloud-node/TestData/" |
|
|
|
const filename = "Book1.xlsx"; |
|
const data =fs.createReadStream(path.join(localPath, filename)); |
|
|
|
const req = new UploadFileRequest({ |
|
path: "Temp/" + filename, |
|
file: data |
|
}); |
|
cellsApi.uploadFile(req) |
|
.then((result) => { |
|
|
|
const req = new Cells_GetWorksheetCellRequest(); |
|
req.name = filename; |
|
req.sheetName = "Sheet1"; |
|
req.cellOrMethodName = 'A1'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'firstcell'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'endcell'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'maxrow'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'maxdatarow'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'maxcolumn'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'maxdatacolumn'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'minrow'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'mindatarow'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'mincolumn'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
req.cellOrMethodName = 'mindatacolumn'; |
|
req.folder = "Temp"; |
|
cellsApi.cellsGetWorksheetCell(req) |
|
.then((result) => { |
|
console.log("cellsGetWorksheetCell test done.") |
|
}) |
|
}) |
|
}) |
|
}) |
|
}) |
|
}) |
|
}) |
|
}) |
|
}) |
|
}) |
|
|
|
}) |
|
}) |