01.02.2013 Views

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Methodology<br />

and <strong>the</strong>ir contents <strong>to</strong> fixed, improves performance. Variable (size) non-graphical<br />

objects require more processing overhead, because <strong>Reports</strong> Builder must<br />

determine <strong>the</strong>ir size before formatting <strong>the</strong>m. However, <strong>the</strong> overhead for fixed<br />

non-graphical objects is less, since <strong>the</strong> additional processing is not required.<br />

■ Make your graphical layout objects (for example, images and graphs) variable in<br />

size by setting <strong>the</strong> Vertical Elasticity and Horizontal Elasticity properties of <strong>the</strong><br />

objects <strong>to</strong> Variable. Fixed graphical objects require more processing overhead as<br />

<strong>the</strong>ir contents have <strong>to</strong> be scaled <strong>to</strong> fit. Variable objects grow or shrink with <strong>the</strong><br />

contents eliminating <strong>the</strong> need for scaling.<br />

■ Make text fields span a line (maximum) and ensure that <strong>the</strong>ir contents fit within<br />

<strong>the</strong> specified width (for example, use <strong>the</strong> SUBSTR function). If a text field spans<br />

more than a line, <strong>Reports</strong> Builder must use its word wrapping algorithm <strong>to</strong> format<br />

that field. Ensuring <strong>the</strong> text field takes only one line <strong>to</strong> format avoids <strong>the</strong><br />

processing overhead of <strong>the</strong> word wrapping algorithm.<br />

■ Minimize <strong>the</strong> use of different formatting attributes (for example, fonts) within <strong>the</strong><br />

same field or boilerplate text, because it takes longer <strong>to</strong> format.<br />

■ Use <strong>the</strong> SUBSTR function in <strong>the</strong> report query <strong>to</strong> truncate <strong>the</strong> data at <strong>the</strong> database<br />

level, instead of truncating a character string from a field in <strong>the</strong> Report Builder<br />

layout.<br />

■ For paper layout only reports, .rdf and .rep files run faster than a.jsp file,<br />

because <strong>the</strong> serialized formats of a .rdf or a .rep file do not require parsing.<br />

Additionally, a .rep file runs faster than a .rdf file as it is optimized for <strong>the</strong><br />

current platform.<br />

20.1.3.1.1 Format Triggers in a Paper Layout Format triggers can dynamically disable,<br />

enable, and change <strong>the</strong> appearance of an object. Exercise caution when using <strong>the</strong>m as<br />

<strong>the</strong>y fire each time an instance of <strong>the</strong>ir associated object is produced and formatted (at<br />

runtime).<br />

Consider <strong>the</strong> following example, on <strong>the</strong> use of format triggers:<br />

A tabular report includes a single repeating frame that expands vertically and has <strong>the</strong><br />

Page Protect property set <strong>to</strong> On. As <strong>the</strong> report is formatted, <strong>the</strong>re is room for one more<br />

line at <strong>the</strong> bot<strong>to</strong>m of <strong>the</strong> first page. <strong>Oracle</strong> <strong>Reports</strong> starts <strong>to</strong> format <strong>the</strong> next instance of<br />

<strong>the</strong> repeating frame and fires its associated format trigger. One of <strong>the</strong> objects inside <strong>the</strong><br />

repeating frame is found <strong>to</strong> have expanded and this instance of <strong>the</strong> repeating frame is<br />

moved <strong>to</strong> <strong>the</strong> following page. The format trigger for <strong>the</strong> repeating frame is fired again.<br />

Although <strong>the</strong> repeating frame only appears once (at <strong>the</strong> <strong>to</strong>p of <strong>the</strong> second page), <strong>the</strong><br />

format trigger has fired twice. DML should not be performed in a format trigger,<br />

because you are not sure how many times <strong>the</strong> format trigger will fire for a particular<br />

object.<br />

With <strong>the</strong> example above, had <strong>the</strong> format trigger contained an INSERT statement, <strong>the</strong>n<br />

two rows of data would have been inserted.<br />

Format triggers can be used against repeating frames <strong>to</strong> filter data. However, by<br />

introducing filtering at appropriate levels, you not only improve a report's<br />

performance but also reduce <strong>the</strong> complexity required for this type of a report.<br />

Use <strong>the</strong> following filtering order whenever possible:<br />

■ Modify <strong>the</strong> SQL statement <strong>to</strong> prevent <strong>the</strong> data being returned from <strong>the</strong> server.<br />

■ Use <strong>the</strong> group filter <strong>to</strong> introduce filtering in <strong>the</strong> Data Model.<br />

■ Use return false inside <strong>the</strong> format trigger.<br />

Tuning <strong>Oracle</strong> <strong>Reports</strong> 20-13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!