Ciao a tutti...<br>Ho fatto uno script per la creazione di un report con un elenco di contatti. quando lo eseguo perņ mi da un errore:<br><br><br>Creazione Report<br>Traceback (most recent call last):<br> File "./stampaPdfCoristi.py", line 136, in <module><br>
main()<br> File "./stampaPdfCoristi.py", line 134, in main<br> doc.build(Report)<br> File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 740, in build<br> self.handle_flowable(flowables)<br>
File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 638, in handle_flowable<br> if frame.add(f, self.canv, trySplit=self.allowSplitting):<br> File "/usr/lib/python2.5/site-packages/reportlab/platypus/frames.py", line 141, in _add<br>
w, h = flowable.wrap(aW, h)<br> File "/usr/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 978, in wrap<br> self._calc(availWidth, availHeight)<br> File "/usr/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 526, in _calc<br>
self._calc_width(availWidth,W=W)<br> File "/usr/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 389, in _calc_width<br> t = self._elementWidth(v,s)<br> File "/usr/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 432, in _elementWidth<br>
return max([stringWidth(x,fontName,fontSize) for x in v])<br> File "_rl_accel.c", line 1102, in stringWidthU<br> File "_rl_accel.c", line 1149, in _instanceStringWidthU<br> File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode<br>
return codecs.utf_8_decode(input, errors, True)<br>UnicodeDecodeError: 'utf8' codec can't decode bytes in position 4-8: unsupported Unicode code range<br><br>lo script esegue una connessione ad un database per recuperare i dati e con un ciclo for creo la tabella.<br>
<br>come posso risolvere il problema? in allegato vi metto lo script. <br><br>ciao e grazie mille per l'aiuto.<br clear="all"><br>-- <br>Zanon Samuele<br>mailto:<a href="mailto:webs86@gmail.com">webs86@gmail.com</a>