ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: jplevene on November 03, 2025, 06:16:05 pm

Title: Importing Excel from <input type="file"> error
Post by: jplevene on November 03, 2025, 06:16:05 pm
My code is simple:

Code: [Select]
$("#fileInput").change(function(e){
var file = e.target.files[0],
filename = file ? file.name.toLowerCase() : "";

if(file && (filename.endsWith("csv") || filename.endsWith("xlsx")))
{
pq.excel.importXl({ file:file }, function(wb) {
if(wb)
{
// Import the workbook
$("#grid")
.pqGrid("importWb", { workbook: wb, sheets:[0] });
}
});
}
});

I get the attached error from the line "pq.excel.importXl({ file:file }, function(wb) {"

Any ideas???

Title: Re: Importing Excel from <input type="file"> error
Post by: paramvir on November 03, 2025, 06:36:17 pm
The sheets parameter belongs to the importXl method, not importWb.

Please check if this resolves the error.
Title: Re: Importing Excel from <input type="file"> error
Post by: jplevene on November 03, 2025, 08:58:05 pm
I changed import Wb to importXl, but it made no difference because it doesn't get that far, it breaks before that on
Code: [Select]
pq.excel.importXl({ file:file }, function(wb) {
Unless I have misunderstood, please could you post the changes you mean.
Title: Re: Importing Excel from <input type="file"> error
Post by: paramvir on November 03, 2025, 09:30:46 pm
I meant:

Code: [Select]
pq.excel.importXl({ file:file, sheets: [0] }, function(wb) {

can you please share your spreadsheet as an attachment, you can email it to support if it's too big.
Title: Re: Importing Excel from <input type="file"> error
Post by: jplevene on November 03, 2025, 09:39:07 pm
I had already done that and it was left in the code above by accident.

Seet attached and I am still on v10.1.0
Title: Re: Importing Excel from <input type="file"> error
Post by: paramvir on November 04, 2025, 09:07:51 pm
Confirmed an issue with v10.1.0, please upgrade to v11.0.0 as the issue is fixed in the latest version.
Title: Re: Importing Excel from <input type="file"> error
Post by: jplevene on November 07, 2025, 07:38:09 pm
Please can you post a patch or a few lines of code fix for v10.1 as we haven't upgraded and tested v11 yet.