StyledParagraph
report_paragraph TPTReport.StyledParagraph(string text)
This function generates a paragraph with styled text. Style attributes can be given to text fragments by using a HTML like syntax. Only the following attributes are available which may not be nested:
- bold fragments can be created with <b>bold</b>
- italic fragments can be created with <i>italic</i>
- underlined fragments can be created with <u>underline</u>
- code fragments can be created with <code>code</code> (works for HTML only and will be ignored in PDF reports)
- links can be created with <a href="http://link.target.com">Text</a>
- Colored Text can be used with <font color="#Fa04e0">Colored Text</font>
Parameters:
text the text for this paragraph together with style attributes.
Returns:
the new paragraph that can be added to report
Examples:
# create a bold and underlined paragraph in report
p = TPTReport.StyledParagraph(r"This <u>is</u> an <b>example</b>.");
TPTReport.add(p);