Error when loading from an excel file

Error when loading from an excel file.
The development environment is SpringBoot, JSP.

OK code

  • spreadsheet.load( “”, “xlsx”);
    Error code
  • spreadsheet.load( “static/xls/test.xlsx”, “xlsx”);

full code is:

var spreadsheet = new dhx.Spreadsheet("spreadsheet", {
   menu: true,
  toolbarBlocks: ["default", "file"],
 });
		
function importXlsx() {
	// exception throw
	spreadsheet.load( "static/xls/test.xlsx", "xlsx");
}

   function exportXlsx() {
	spreadsheet.export.xlsx();
}

Error Log
RuntimeError: unreachable
at lib.wasm:0x34170
at lib.wasm:0x357c3
at lib.wasm:0x35173
at lib.wasm:0x352d5
at lib.wasm:0x33ff9
at xlsx_new (lib.wasm:0x10ab9)
at Function.new (worker.js:348)
at doConvert (worker.js:451)
at worker.js:473

Please, make sure that you’ve imported the excel2json library and followed the steps provided here:
https://docs.dhtmlx.com/spreadsheet/loading_data.html#externaldataloading

Hello, i also tried uploading the file, then using excel2json worker - error:

RuntimeError: unreachable
at lib.wasm:0x34170
at lib.wasm:0x357c3
at lib.wasm:0x35173
at lib.wasm:0x352d5
at lib.wasm:0x33ff9
at lib.wasm:0x10ab9
at Function.new (worker.js:348)
at doConvert (worker.js:451)
at worker.js:473

how can i import a local file without opening a dialog box?

Also an error when using the importworker:

 RuntimeError: unreachable
    at rust_panic (lib.wasm:0x3b2c8)
    at std::panicking::rust_panic_with_hook::hc2ec7be1238a7bbd (lib.wasm:0x39f4e)
    at std::panicking::continue_panic_fmt::h24582d7dd7d6cc71 (lib.wasm:0x3ac95)
    at rust_begin_unwind (lib.wasm:0x3b236)
    at core::panicking::panic_fmt::h15a4056a4cc61a13 (lib.wasm:0x3a737)
    at core::result::unwrap_failed::h1aead7fde4dc0cdd (lib.wasm:0x39a85)
    at xlsx_new (lib.wasm:0x12876)
    at Function.new (worker.js:342)
    at doConvert (worker.js:439)
    at worker.js:460

I apologize for that delay with the reply.
Thank you for your report. The problem is confirmed. we’ll try to fix it in one of the future updates.
I’ll inform here about the progress of this issue.

Hi, I was wondering if there were any update on the subject ? I am getting the same error for the same feature

We’re planning to fix that problem in the next spreadsheet update (4.3).
I’ll inform you here when the fix will be available.

Hello there.

The dhx.Spreadsheet 4.3 was successfully released and this problem is now fixed.
Loading from the xlsx files should work well.
Please, try to download the latest available dhx.Spreadsheet build from your client’s area to get that fix.

I tried to implement the same using the new 4.3 version, still the error is there.

The code is:

this.spSh = new dhx.Spreadsheet(this.container.nativeElement, {
toolbarBlocks: [],
menu: false,
editLine: false,
rowsCount: 10,
colsCount: 5,
importModulePath: “https://cdn.dhtmlx.com/libs/excel2json/1.0/worker.js”
});

this.spSh.load("./assets/dhx-spreadsheet/15767108-7569-4a07-b9c0-e5977941da32.xlsx", “xlsx”)

Error as below:
RuntimeError: unreachable
at rust_panic (lib.wasm:0x3b2c8)
at std::panicking::rust_panic_with_hook::hc2ec7be1238a7bbd (lib.wasm:0x39f4e)
at std::panicking::continue_panic_fmt::h24582d7dd7d6cc71 (lib.wasm:0x3ac95)
at rust_begin_unwind (lib.wasm:0x3b236)
at core::panicking::panic_fmt::h15a4056a4cc61a13 (lib.wasm:0x3a737)
at core::panicking::panic::hc2f61635fb33907c (lib.wasm:0x39e1f)
at alloc::raw_vec::capacity_overflow::h7611ecf82ba22c8d (lib.wasm:0x3b21a)
at <alloc::raw_vec::RawVec<T, A>>::reserve::h1ed8d3717cee6d6d (lib.wasm:0x38131)
at xlsx_export::XLSX::read_sheet::h5654409a2d926e68 (lib.wasm:0x13e05)
at xlsx_get_sheet_data (lib.wasm:0x24562)

One update on this that this problem is occurring when a file is generated from OpenXML or any other tool via code.

Attached is the file, however if the file is Saved via excel it seems to work.

Generate-OpenXML.xlsx (2.2 KB)

Importing your generated xlsx file throws an error that the styles are missing.
Please, check if you you’ve added the stylesheet to your xlsx generator.
We’ll also check this problem on our side.

1 Like