Get all the pages of data into a single DataTable. Calls to getAllPagesAsync() after releaseAsync() will throw an exception. To protect against possible browser failure, getAllPagesAsync will cap the data at a maximum of 400 pages. With a default pageRowCount of 10,000 this will give you a maximum of 4,000,000 rows of data.
If sizes are larger than this, please process your data in page size chunks.
Limits the request to maxRows. If maxRows === 0, requests all rows.
A DataTable containing all the data available to the DataTableReader with the maximum page count above.
// To simplify the example, we assume we have less than 4m rows of data
// Since we are fetching all of the data, use the default page size in getSummaryDataReaderAsync
const dataTableReader = await worksheet.getSummaryDataReaderAsync();
const dataTable = await dataTableReader.getAllPagesAsync();
await dataTableReader.releaseAsync();
// ... process the data table ...
Get a page of data. The page is returned as a DataTable. Calls to getPageAsync() after releaseAsync() will throw an exception.
The page number (zero-indexed) to fetch. The page number should be treated like an array index with range: 0 <= pageNumber < pageCount.
A DataTable containing the requested page. The number of rows returned can be less than the page size at the end of the data.
const pageRowCount = 200;
const dataTableReader = await worksheet.getSummaryDataReaderAsync(pageRowCount, options);
for (let currentPage = 0; currentPage < dataTableReader.pageCount; currentPage++) {
const currentPageDataTable = await dataTableReader.getPageAsync(currentPage);
// ... process current page ...
}
await dataTableReader.releaseAsync();
Release all resources held by the DataTableReader. Calling this when done with the DataTableReader is required practice as it frees up resources. Calls to getPageAsync() after releaseAsync() will throw an exception.
A DataTableReader allows iteration over summary or underlying data by pages. The page size is established when the DataTableReader is created. (See getLogicalTableDataReaderAsync, getSummaryDataReaderAsync, or getUnderlyingTableDataReaderAsync.) The normal sequence of operations would be to
Notes for usage of a DataTableReader: