User`s guide
13 Create a Report Program
13-24
Use Format Properties
Most DOM objects have a set of properties corresponding to the format options most
commonly used for an object of that class. You can use dot notation with format
properties to specify formats for an object. For example, the following code sets the font
and color of text in a paragraph, using the Color, FontFamily, and FontSize format
properties of a Paragraph object.
p = Paragraph('Danger!');
p.Color = 'red';
p.FontFamily = 'Arial';
p.FontSize = '18pt';
Assigning a value to a format property causes the API to create an equivalent format
object and assign it to the Style property of the document object. Similarly, assigning
a format object to an object's Style property causes the API to assign an equivalent
value to the corresponding format property if it exists. In this way, the API keeps format
properties for an object in sync with the Style property of the object.
Note: When you change the value of a format property, the DOM API:
• Creates a clone of the corresponding format object
• Changes the value of the clone's corresponding format object property
• Replaces the original format object with the clone in the array of format objects
assigned to the document object
In this way, the DOM prevents changing a format property in one object from changing a
style originally assigned to other objects as well.
More About
• “Report Formatting Approaches” on page 13-20
• “Format Inheritance” on page 13-25