FlexGrid Import To Excel Options

Posted by: trac-do on 14 September 2017, 12:02 pm EST

    • Post Options:
    • Link

    Posted 14 September 2017, 12:02 pm EST

    We’re working on the importing of excel file into flexgrid and I have 2 questions:

    1. Is there a way to load a specific sheet into flexgrid? I’ve tried to specify sheetName like below but it doesn’t work. it only loads the first sheet.

      loadAsync(this.flexGrid, fileInput.files[0], { includeColumnHeaders: this.includeColumnHeader, sheetName: ‘Sheet3’ });

    2. Can i specify mapping of columns from the excel sheet to the binded columns already specified for the grid? For example

      <wj-flex-grid-column [header]=“‘Category’” [binding]=“‘category’”></wj-flex-grid-column> but on my excelsheet, it’s named “CAT”.

      We have a lot of preexisting excel files and the import helps to ease the transition. it’s very time consuming to go back and rename the sheet to match the bindings on the flexgrid. Also the excel files are being used by another process so renaming will break that process.

    Even when i tried to edit the sheet i wanted to be the first one with columns matching the grid binding but out of order, says column “CAT” is first one on the grid, but in the sheet, it’s column number 2, seems like it completely destroys the old grid binding and create a new grid same order as the sheet.

    Thanks

  • Posted 14 September 2017, 12:03 pm EST

    Hello,

    You can load specific sheet from Excel Sheet by specifying sheetIndex. For this, use following code snippet:

    wijmo.grid.xlsx.FlexGridXlsxConverter.load(grid, importFile, { sheetIndex: 1 });

    Regarding mapping of columns from Excel to FlexGrid,

    Just for information, when sheet is loaded in FlexGrid, it recycle complete FlexGrid and update with sheet data along with columnHeader.

    Thanks,

    Manish Kumar Gupta

  • Posted 14 September 2017, 12:03 pm EST

    Using sheetIndex is not very flexible as the sheet is not always at index 1, Can I obtain the sheetIndex by passing over the sheetName thru the api somehow?

    Regarding the import, that’s very disappointing. I don’t see the point of using the import feature beside viewing what’s in the excel? If I want to view excel content, I can just open up Excel, why load it into online grid to view it? Without the ability to map the columns and make edit then saving it back to DB, it’s very limiting. Is there any chance this can be added to future version?

    Thanks

  • Posted 14 September 2017, 12:03 pm EST

    Hello,

    For both queries, the solution is same. Load excel sheet in Workbook instance using wijmo.xlsx module’s WorkBook class. Here, you can get desired sheet using sheet name. For binding data to FlexGrid, create data source using sheet data.

    For your reference, please see the attached sample that implements the same.

    However, we have created a case for loading sheet using sheetName support and for binding loaded data to itemsSource for further investigation with tracking id 259121, 259122.

    We will notify you as soon as we get any update on this.

    Thanks,

    Manish Kumar Gupta

    2017/05/FlexGrid_import_export.zip

  • Posted 14 September 2017, 12:03 pm EST

    Thanks a lot, a little bit more work but it will work for now. If the new features get added, it will be very cool.

    Thanks again

  • Posted 26 January 2018, 1:04 am EST

    Hi,

    This issue has been verified as fixed with the build 5.20173.380

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels