[reportlab-users] Special characters in paragraphs

Dick Kniep dick at kniep.nl
Wed Dec 14 04:43:20 EST 2005

Hi list,

We have a problem with special characters used in paragraphs in tables. I get the following error. 

  File "/home/dick/CVix/CVix/src/GenReportLab.py", line 319, in BuildReport
    self.PdfOutput(lvl, content, h, tabStyle, int(self.fontSize)+1 )
  File "/home/dick/CVix/CVix/src/GenReportLab.py", line 344, in PdfOutput
  File "/usr/lib/python2.4/site-packages/reportlab/platypus/paragraph.py", line 378, in __init__
    self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
  File "/usr/lib/python2.4/site-packages/reportlab/platypus/paragraph.py", line 403, in _setup
    raise "xml parser error (%s) in paragraph beginning\n'%s'"\
xml parser error (; missing in entityref) in paragraph beginning
'Den Besten&Sloof'

Note the '&' in the text which causes the crash.

The code to set the contents of the paragraph is:


So the paragraph is added to a reportlab table that is eventually output to a PDF.

I tried :
r.append(Paragraph(unicode(fld),parStyle)). This gives me the same exceptions, however, it complains about a unicode string in the exception.
I tried:
Same error
So if anyone has a simple solution to this problem.
Dick Kniep

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://two.pairlist.net/pipermail/reportlab-users/attachments/20051214/0aa46935/attachment.html

More information about the reportlab-users mailing list