[reportlab-users] Report for multiple objects
Glenn Linderman
v+python at g.nevcal.com
Tue Aug 23 15:11:08 EDT 2011
On 8/23/2011 9:24 AM, Tim Roberts wrote:
> Asif Jamadar wrote:
>> I'm trying to implement custom action in django admin page. When user selects multiple objects from admin page and click on the custom action, that should generate report for each selected object.
>>
>> Suppose user select 4 objects from the admin page, then the custom action should generate 4 reports.
> One web request can only produce one response. That's not a ReportLab
> or a PDF restriction, that's a fundamental HTTP concept.
>
> As I see it, you have two choices. One, you could produce the four
> reports sequentially, combined into one single PDF file. Two, you can
> build a second web page that basically says "here are your 4 reports,
> click on them one at a time to download them."
There are more choices...
Three, (a variation of two) return with a page containing a list of
reports 1-4, use meta-refresh to automatically start the download of the
first report, and allow the user to click on the others to initiate them.
Four, put the 4 reports into a .zip file and download it
Five, (this one depends on client side scripting, and is theoretical (I
haven't tried it)), return a page that uses scripting to initiate 4
requests, one for each report; each would pop up a dialog to save the
report when the download response arrives. If anyone gets this one
working, please share the results :) I've been wanting to try it for a
while, but have had higher priority projects...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20110823/22b4b205/attachment.html>
More information about the reportlab-users
mailing list