Also it might be worth considering export to CSV.

On Thu, Dec 13, 2012 at 6:51 AM, Jim S <[email protected]> wrote:
> I'm looking for a way to return an Excel sheet to the user and then redirect
> to a different page all in the same request.
>
> Here is what I'm doing now:
>
> from reports import movementDetail as rpt
> letters_file = StringIO.StringIO()
> returnVal = rpt.process(originationId, fromDate, toDate, letters_file,
> auth.user.id)
> if returnVal:
>     excelFile = letters_file.getvalue()
>     letters_file.close()
>     response.headers['Content-Type']='application/vnd.ms-excel'
>     return(excelFile)
> else:
>     response.flash = 'No movements for specific origin in date range.'
>     return dict(form=form)
>
> When I do the return(excelFile) I somehow would like to pass a URL that it
> would redirect to when the excel sheet is returned.  Any ideas?  I'm
> guessing there is something simple I'm missing.
>
> -Jim
>
> --
>
>
>

-- 



Reply via email to