ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: kshipra on November 27, 2018, 06:02:23 pm

Title: Import xslx spreadsheet
Post by: kshipra on November 27, 2018, 06:02:23 pm
I have requirement to upload data from excel sheet with varying columns into database.

I can think of 2 options:

1. Upload csv files and parse it.

2. I am thinking of using import xslx option. I can import any excel file in web UI. I was wondering
    * how can I validate the excel sheet on client side to make sure there are certain required columns ?
    * how can i send this data to server? 
      would grid.getData(); work?  Is there any better option?


Title: Re: Import xslx spreadsheet
Post by: paramvir on November 28, 2018, 01:09:52 pm
That depends upon how you identify the required columns. Excel spreadsheet doesn't have concept of dataIndx of fields.

You can persist the spreadsheet data by either exporting it to js workbook or exporting it to Excel xlsx file.

It has the benefit of preserving the formulas, merge cells which are lost if converted into another format like json, csv.
Title: Re: Import xslx spreadsheet
Post by: kshipra on November 28, 2018, 04:55:24 pm
I am trying to understand import functionality. So if pqgrid on import does not get initialized and its methods and options will not work on imported excel sheet then why would we want to use import ?
Title: Re: Import xslx spreadsheet
Post by: paramvir on November 28, 2018, 05:49:49 pm
Of course pqgrid is initialized and its API works on imported Excel sheet. I didn't say that, did I? :)

Yes you can use grid.getData() method to get data in grid and check 1st or nth row to check presence of certain columns in your spreadsheet.

This is the demo of import from Excel: https://paramquery.com/pro/demos/import-xlsx
Title: Re: Import xslx spreadsheet
Post by: kshipra on December 07, 2018, 01:24:20 pm
Can import of csv be also supported ? it does not work currently.
Title: Re: Import xslx spreadsheet
Post by: paramvir on December 10, 2018, 11:59:44 am
Import of csv is not related to import of xlsx and is not available currently.