User`s guide
Create and Format Paragraphs
13-47
Format a Paragraph
You can format a paragraph programmatically, using DOM format objects or format
properties. You can also use Word and HTML template styles. For information about
these formatting techniques and format inheritance, see “Report Formatting Approaches”
on page 13-20.
Note: You can use the same format objects and properties for Heading objects as you do
for Paragraph objects.
Format a Paragraph Programmatically
You can use format objects to format Paragraph objects or format properties to specify
commonly used paragraph formats. This example uses:
• An OuterMargin format object to specify the margins for the paragraph
• The HAlign format property to center the paragraph
import mlreportgen.dom.*;
doc = Document('test','html');
p = Paragraph('Indent a half inch and space after 12 points.');
p.Style = {OuterMargin('0.5in','0in','0in','12pt')};
append(doc,p);
p = Paragraph('Centered paragraph');
p.HAlign = 'center';
append(doc,p);
close(doc);
rptview('test','html');
Use these format objects and format properties to format a paragraph.
Formatting Format Object Format Property
Font FontFamily FontFamilyName
Backup font (HTML only) FontFamily n/a
Complex script font (for
example, Arabic)
FontFamily n/a