Hello,
I need some urgent help. I have a function that generates a report in
excel, the report returns the data that i need the problem es that i
am getting some strange characters like: Í , ó, ñ, etc...
I have tried with django smart_unicode and force_unicode but nothing
happens.
Is there i way i could solve this?
Here is my function:
def encuesta_reporte(request):
import csv
from django.http import HttpResponse
from django.template import loader, Context
from django.utils.encoding import smart_unicode
# Query.
school_id = School.objects.get(id = 256)
data = School_Answer.objects.filter(school = school_id)
temp = render_to_response('my_template_name.html',
{'data':data,
'docente_id':docente_id,},
context_instance = RequestContext
(request),
)
response = HttpResponse(temp, mimetype='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment;
filename=report_school.xls'
return response
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---