Generating offline excel report

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
nalawadevijay
Forum Newbie
Posts: 2
Joined: Sat Feb 06, 2010 1:44 am

Generating offline excel report

Post by nalawadevijay »

Hi,

I'm running php site having sql server database. I've given facility to generate excel report having large data in that. Now I'm getting trouble while multiple user download report simultaneously as it slows down the site due to large queries.

so is there any way such that, if one use user requests for report, then it should run in background mode in sql server & may be creating temporary table, then after 10-15 min, php will get data directly from resultant table. so it would save time to wait for executing query & collecting result. This is just one of my idea, so is this possible or please let me know if you've any other ideas.

I'm not sure whether I should ask this question in this category or now. But any help is most appreciable.

Thanks in advance,


Vijay
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Generating offline excel report

Post by Christopher »

Generally you would put your request in some sort of queue (often a database table) and then have a cron process items in the queue. You could also use a server like Gearman to do this on one or more servers.

The other side of the question is how the user receives notification. The queue processor could email the user, or the web page could refresh and poll the queue to see if the job has been processed.
(#10850)
nalawadevijay
Forum Newbie
Posts: 2
Joined: Sat Feb 06, 2010 1:44 am

Re: Generating offline excel report

Post by nalawadevijay »

Thanks for ur reply.

But I'm getting problem, if user requests for "A" report so I"ll create temporary table for that & again if another user try to download "B" report which is different in structure & data from "A", so how can I manage that?

Actually I cant create separate temporary table for each user as there would be many requests simultaneously.

Thanks
Post Reply