ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: entwine.llc.wi on January 27, 2022, 09:28:44 am

Title: Invalid format error with XLSX export
Post by: entwine.llc.wi on January 27, 2022, 09:28:44 am
Ever since I updated to version 8.1.0 of ParamQuery Pro I have been unable to export Excel files.

I am using the sample code from here: https://paramquery.com/demos/export_local (https://paramquery.com/demos/export_local)

I have attached an image of the error message. It basically says that either the file format or the file extension are incorrect.


Title: Re: Invalid format error with XLSX export
Post by: paramvir on January 27, 2022, 10:23:47 am
What was your last version before upgrading to v8.1.0

Could you attach/send the Excel file which is causing this error.
Title: Re: Invalid format error with XLSX export
Post by: entwine.llc.wi on January 30, 2022, 02:08:29 am
I was on 6.1.0.

I have attached one of the spreadsheets in a zip file.

Thanks
Title: Re: Invalid format error with XLSX export
Post by: paramvir on January 31, 2022, 01:31:18 pm
Have you made any custom changes in the SDK pqgrid js file?

Could you please share a sample script from which you have exported this xlsx file?
Title: Re: Invalid format error with XLSX export
Post by: entwine.llc.wi on February 03, 2022, 09:17:35 am
I have not made any changes to the pqgrid.js file.

I'm not sure whether you need to see the entire page or not. It is an MVC project, written in C# on the backend.


I am using the script from one of your demos for the toolbar button.

                    items: [
                        {
                            type: 'select',
                            label: 'Format: ',
                            attr: 'id="export_format"',
                            options: [{ xlsx: 'Excel', csv: 'Csv', htm: 'Html', json: 'Json' }]
                        },
                        {
                            type: 'button',
                            label: "Export",
                            icon: 'ui-icon-arrowthickstop-1-s',
                            listener: function () {
                                var format = $("#export_format").val(),
                                    blob = this.exportData({
                                        format: format,
                                        nopqdata: true, //applicable for JSON export.                       
                                        render: true
                                    });
                                if (typeof blob === "string") {
                                    blob = new Blob([blob]);
                                }
                                saveAs(blob, "pqGrid." + format);
                            }
                        },
Title: Re: Invalid format error with XLSX export
Post by: paramvir on February 04, 2022, 05:35:57 pm
Your script to export xlsx file looks fine.

The internal structure of xlsx file attached in your previous post doesn't match with that of pqgrid exported xlsx file. Kindly verify that you are using the original pqgrid SDK files without any changes. Please download fresh copy of the SDK and recheck.

or Kindly share a jsfiddle reproducing the issue so that I can check it for you.
Title: Re: Invalid format error with XLSX export
Post by: entwine.llc.wi on February 07, 2022, 08:31:59 am
Hello,

I had not changed any of the original SDK files. Regardless, updating the SDK seems to have fixed it.  Thank you.