>
>     return response.stream(open(request.folder+'/static/temp.pdf', 
> 'rb'),chunk_size=4096)
>     #  pdf.output(pfile, 'F')
>     redirect(URL("index")) 
>

Will the execution ever reach redirect statement above ?
I'm interested because I have a report page which generates the reports 
based on form submit.
User also has option to show PDF report (checkbox)
I use appreport plugin to return the PDF. My code looks something like this 
...

    return_dict = dict(key1=val1, key2=val2) #Some values that make send to 
the template
    if pdfreport is not None and pdfreport == 'on':
        html = response.render('default/pdfreport.html', return_dict)
        pdfName = "mypdfname.pdf"
        return plugin_appreport.REPORTPISA(html=html,
                                           response_filename=pdfName)
    else:
        return return_dict

Here is the problem :

When I use HTML report (last statement after else) - user is shown a 
different page, but when I select and return PDF report, use stays on the 
same page, but the "form" is in some weird state. i.e user can click 
"submit" again but nothing happens till user "refreshes" the page.

I had something like the above in mind, where user is redirected to the 
"same" page, but the page is refreshed - AFTER pdf is returned to the user. 
But I don't think any code after "return" would work.

Any work around to redirect the user after PDF is returned (via appreport?)

Thanks,
-Mandar

-- 



Reply via email to