I suspect the issue is the response you are returning. I have never seen
attachments on HTTP responses: can't you just return the contents of the
"output.xls" file by writing it to response before returning it? You
would also need to remove the "Content-Disposition" header.

Just a thought.

regards
 Steve

laspal wrote:
> Any one can help me out.
> Thanks.
> 
> On Oct 29, 11:41 am, laspal <[EMAIL PROTECTED]> wrote:
>> Hi,
>> I am trying to create Excel file usingpyExceleratorbut my problem is
>> I am not able
>> to attach file to response.
>>
>> code :
>>     workbook = Workbook()
>>     worksheet = workbook.add_sheet('My Test Sheet')
>>
>>     worksheet.write(0,0, 'Company', font_style('left', 1, 'red'))
>>     worksheet.write(1,1, 'Hello World!', font_style('left', 1,
>> 'black'))
>>     worksheet.write(1,0, 'Hello World!', font_style('left', 1, 'red'))
>>
>>     response = HttpResponse( mimetype='application/vnd.ms-excel')
>>     response['Content-Disposition'] = 'attachment;
>> filename=output.xls'
>>     workbook.save('output.xls')
>>
>>    return response.
>>
>> I am able to generate output.xl file but without any data.
>> Can anyone help me out
>> Thanks.
> > 
> 


-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to