Get value on multisheet


#1

Hello!
I downloaded the 30-day version to check it out. I liked it very much! Our company plans to buy this component, but there are several questions about the api:

  1. I import an xlsx file with many tables (multisheets), determine the number of tables through the getSheets method - I receive an array like NAME, ID.
    Tell me, how can I get values ​​from a cell from a specific table (not from the first, but, for example, the second or tenth)?

  2. is it possible to export not to disk as an xlsx file, but to memory - for example, Blob?

  3. i have imported xlsx into a table. How can I determine the maximum number of columns and rows in a file?

  4. when serializing large files, is it possible to use the serialize method as a promise?

Thanks!


#2
  1. I import an xlsx file with many tables (multitables), determine the number of tables through the getSheets method - I receive an array like NAME, ID.
    Tell me, how can I get values from a cell of a certain table (not from the first, but, for example, the second or tenth)?

You may try to use the getValue() method:

https://docs.dhtmlx.com/spreadsheet/api/spreadsheet_getvalue_method/

Starting with v4.1, the reference to a cell or range of cells can be specified in the following format:

var cellValue = spreadsheet.getValue("sheet1!A2"); //-> 25000

where sheet1 is the name of the tab.

  1. is it possible to export not to disk as an xlsx file, but to memory - for example, Blob?

Unfortunately, such a feature is not supported. I can only suggest you serialize your spreadsheet to JSON object:

https://docs.dhtmlx.com/spreadsheet/api/spreadsheet_serialize_method/

  1. i have imported xlsx into a table. How can I determine the maximum number of columns and rows in a file?

You may try to operate with the serialized data of your spreadsheet.

Like:

const sheet_data = spreadsheet.serialize().sheets[sheet_ind].data;
const last_cell = sheet_data[sheet_data.length-1];
console.log(last_cell.cell)

https://snippet.dhtmlx.com/mz2bwr2g

  1. when serializing large files, is it possible to use the serialize method as a promise?

Unfortunately, there is no such possibility. The serialize() method works in sync mode only.