Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Alternative to my approach to display and then download large records

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On my User Interface, there is an Advanced Search section where user selects 5-7 things from the 5-7 different dropdown menu and based on these parameters, a web service is called. The webservice returns the search results in a JSON format and those records are displayed in a tabular format in the User Interface.

Something like this : http://jsfiddle.net/jqwidgets/6HRU8)

So I have a Download button below the tabular section where all records are displayed, just like shown in the jsfiddle above.

If I have to download the records in excel format as soon as user clicks the download button, is there something better than using jQXwidgets that is used in the JSFiddle and in my code as well?

The reason I want to go away from jqxwidget is that they are asking to supply a URL hosted on my RHEL server and that’s causing issues to me in setting up virtualhost on Apache etc. The reason they are asking is that the records are around 2000 or more and to handle the load I need to have their solution on my server.
 
Master Rancher
Posts: 4701
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us a diagram of the architecture?
That is, what the different parts are and which bits you control?

I'm a bit confused as to which part is yours and which is some external service you call, and is not controlled by you.

Because, if I had control of this I would just have the download button request an excel copy off the server, and the server would redo the query, but instead of returning JSON it would create an XLSX file instead (or CSV if we're talking straight data, which would be dead easy).
 
Jack Tauson
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Can you show us a diagram of the architecture?
That is, what the different parts are and which bits you control?

I'm a bit confused as to which part is yours and which is some external service you call, and is not controlled by you.

Because, if I had control of this I would just have the download button request an excel copy off the server, and the server would redo the query, but instead of returning JSON it would create an XLSX file instead (or CSV if we're talking straight data, which would be dead easy).



Sure. Please find the UI diagram I just drew on a paper below:




So at first, user sees only the Advanced Search section until the Search and Clear buttons. After selecting things from the drop-down boxes, user clicks on the Search button. This calls a search web service in the backend. A new table shows up with Search results (81702) as shown in the diagram above.

Below the table, I have Export to Excel button. That's where I am having issues since the records are so big and jQWidget I am using is unable ot handle more than 600 records. So they are asking me to host their source code file on my server and so on and so forth.

When you say the following:

Because, if I had control of this I would just have the download button request an excel copy off the server, and the server would redo the query, but instead of returning JSON it would create an XLSX file instead (or CSV if we're talking straight data, which would be dead easy).



I would have to make another webservice call when user clicks on the Export to Excel button, right?
 
Dave Tolls
Master Rancher
Posts: 4701
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it can be the same one with a flag or similar indicating what format to return the results in.
 
Jack Tauson
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Well, it can be the same one with a flag or similar indicating what format to return the results in.



Hmm, so what I understood is that, for the table, I can leave it as JSON response.

For Export to Excel button, I could have a flag to call the same web service with a flag indicating that CSV data is needed. However, at the point, when button is about to click, in order for me to call the same webservice, I would have to remember somewhere in my UI application, maybe in the form of sessionStorage, the name of all the parameters selected/supplied by the user so that I can make a different call.

Are you also suggesting something similar to what I explained above?
 
Dave Tolls
Master Rancher
Posts: 4701
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, somewhere you need to remember what the query parameters were, either in the session or in the page.

Also, it doesn't have to be a flag....it can be another endpoint. It's up to you how to structure it.
 
Jack Tauson
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Yes, somewhere you need to remember what the query parameters were, either in the session or in the page.

Also, it doesn't have to be a flag....it can be another endpoint. It's up to you how to structure it.



I was able to achieve this using JavaScript only. Found this tutorial very useful:

https://www.youtube.com/watch?v=eicLNabvZN8&t=103s
 
Dave Tolls
Master Rancher
Posts: 4701
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good job.

So does your endpoint return all the data in one go?
 
Jack Tauson
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Good job.

So does your endpoint return all the data in one go?



Thanks!
Yeah, it does. I guess as long as I am getting data back to the browser, I  will be able to download the data from the above logic.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic