How to create a bulleted list in ReportLab

后端 未结 2 1082
说谎
说谎 2020-12-31 20:16

How can I create a bulleted list in ReportLab? The documentation is frustratingly vague. I am trying:

text = ur \'\'\'
         


        
相关标签:
2条回答
  • 2020-12-31 20:41

    The very recent versions of ReportLab have ListFlowable and ListItem objects (check Chapter 9 of the current user guide).

    0 讨论(0)
  • 2020-12-31 21:03

    The bulletText argument is actually a constructor to the Paragraph object, not the <para> tag :-) Try this:

    story.append(Paragraph(text, TEXT_STYLE, bulletText='-'))
    

    Have a look at the examples on page 68 (page 74 now, in 2012) of the ReportLab Documentation, though. The convention in ReportLab seems to be to use the <bullet> tag, and the docs do warn that you can have only one per Paragraph instance. We render our bullets in ReportLab like so:

    story.append(Paragraph('<bullet>The rain in spain</bullet>', TEXT_STYLE))
    
    0 讨论(0)
提交回复
热议问题