Data Source with 7 data sets

Data Source with 7 data sets

TerryMiddletonTerryMiddleton Posts: 4Questions: 1Answers: 0

I'm trying to figure the best way to implement this...

I have a Excel (xls) that lists 'support hardware' products for our system based on the version of software on the system. For example, Win 10 supports these products, Win XP supports these products, and Win 11 supports these.

In the xls, we have a 'Sheet' for each version of the software that lists the 'supported hardware'. In my case we have 7 sheets named for each version of the software.

I want to allow the user to select a software version from a dropdown and the data in the table show only those products that are supported for that version, then allow the user to search through the list based on the column/row data.

In my mind, I'm thinking I should create a JSON file from the xls that switches out the data when a user selects a version from the dropdown.

Or, I guess I could create a different data source file for each version of the software and switch the data source after the version is selected.

I'm hoping to get someone's perspective on the best and efferent way to solve this.

Your insights would be most appreciated.

Terry

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin

    Are you going to be using the xls file as the "backend"? I.e. already reading from the xls file rather than reading from a database or the like?

    This is CloudTables but it could also be done in just DataTables (I'm linking to the CloudTables one, as I don't have a plain DataTables one to demonstrate what I'm thinking of, so we can visualise it!).

    In that example you'll be able to see that each person can be assigned to multiple offices - to my mind that maps to use case having one entry per piece of hardware and then a list of "tags" for the supported OS. Than you could filter by OS or by item (or both).

    In terms of a JSON feed to allow a DataTable like that to be built, something like:

    [
      { "item": "GTX 2070", "os": [ "Win10", "Win11" ] },
      { "item": "GTX 2080", "os": [ "Win8", "Win10", "Win11" ] }
    ]
    

    could be used.

    Allan

  • TerryMiddletonTerryMiddleton Posts: 4Questions: 1Answers: 0

    Allan @allan - Thank you for your reply.

    I am given the xls to be used as the backend. Initially I simply read through the single sheet and produced (using Python) an HTML table that I used as the data source.

    Now, they gave me an xls that has 7 sheets (1 for each version of the software) and I do not have the ability to change how the xls is created.

    It would be nice (and efficient) to have one product record with multiple tags to denote the version, however currently I don't have the ability to change how the xls is produced.

    Using JSON seemed the best way (I think, but maybe not). I would need to have seven different datasets (one for each xls sheet).

    Can I even switch data sources/datasets based on the version a user selects from a dropdown?

    My thinking was to (and this is where I'm hoping for insight) read in all sheets into a JSON file, and refresh the datatable to a new dataset based on what the user has selected in the dropdown.

    I'm not married to this way of doing it, I just do not have a way to change the way the xls file is structured before it is given to me.

    Terry

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    edited June 2022

    Hi Terry,

    If you basically just want to display the seven sheets, with a drop-down to select which sheet's days of actually being shown, then a JSON feed from the xls file sounds good to me. Just swap the part of the JSON feed as needed.

    Allan

Sign In or Register to comment.