Recordset reusing

9 views
Skip to first unread message

txapelgorri

unread,
Aug 9, 2011, 7:51:04 AM8/9/11
to Hobo Users
Hi there:

I really don't know if this point has been previously discussed
before, but anyway here it goes :)
I have a Reports section on a Hobo app. From that section, users can
search and generate custom searches applying some filters. The search
result is renderized usually on table-pluses, but the users must have
the possibilty to export the online/screen results to LibreOffice Calc
or PDF files, and here comes my doubt: currently I have to "save" the
applyed values to filters to re-do the query to the database, and to
obtain the same result, and finally obtain the document.
In short: two identical queries to achieve same results, first one to
generate the table-plus and show the results on the screen, and the
second one when the user clicks on "Get this on PDF" :S

I would like to know if anyone has workaround this with some Hobo
facility or Rails one, reusing in somehow the same recordset you
generate at the first query.

Thanks in advance, Ibon.

kevinpfromnm

unread,
Aug 9, 2011, 12:08:59 PM8/9/11
to hobo...@googlegroups.com
The only way I could see doing it with one query is to generate the file at the same time as the table-plus.  Usually this isn't a desirable course of action as it takes extra time to make the file, time which slows the http response.  Unless the query is significantly longer to execute than the time to build the pdf, I'd stick with the 2 query version you have.  Alternatively, you could implement some sort of temporary cache (like memcache) using the query parameters to store the results.
Reply all
Reply to author
Forward
0 new messages