After defining Data model the report’s layout must be specified.
Several important concepts and properties apply to layout objects:
- the frequency with which you want the object to appear in the report, specified by the Print Object On property
- how Reports Builder fetches and formats data for instances of repeating frames, specified by the Column Mode property
- whether to keep an object and the object to which it is anchored on the same logical page, specified by the Keep With Anchoring Object property
- whether to try to keep the entire object and its contents on the same logical page, specified by the Page Protect property
- format triggers, which are PL/SQL functions executed before an object is formatted that can dynamically change the formatting attributes of objects
- report layout, generated by defaulting applied by Reports Builder, modified in the Paper Layout view, or created from scratch.
The following are the Layout Components:
Frames
Frames surround other objects and protect them from being overwritten or pushed by other objects.For example, a frame might be used to surround all objects owned by a group, to surround column headings, or to surround summaries.
When you default the layout for a report, Reports Builder creates frames around report objects as needed; you can also create a frame manually in the Paper Layout view.
Create frames when you want to:
· Group together objects to ensure they maintain their relative positions during printing.
· Delineate sections in your report.
Example: You want the top of each page to have a tabular format, but the bottom of each page to have a matrix format.
· Protect other objects from being overwritten.
Example: A summary is centered under two repeating frames.
Defaulting rules state that the summary must remain at a fixed distance
from only the first object that can overwrite it; therefore, the summary
is in danger of being overwritten by the second repeating frame.
Enclosing both repeating frames with a frame will force the summary to
maintain a fixed distance from both of them, and it will not be
overwritten.
· Prevent an object from printing until other objects finish printing.
Example: A summary is centered under two repeating frames.
According to defaulting rules, the summary will print as soon as the
first repeating frame finishes printing. Create a frame around the two
repeating frames to ensure the summary prints after both repeating
frames have finished printing.
Repeating Frames
Repeating frames surround all of the fields that are created for a
group’s columns. Therepeating frame prints (is fired) once for each
record of the group.When you default the layout for a report, Reports Builder generates one repeating frame for each group in the data model, and places one field inside it for each of the group’s columns. Repeating frames can enclose any layout object, including other repeating frames. Nested repeating frames are typically used to produce master/detail and break reports. For each record of the outer repeating frame, Reports Builder will format all related records of the enclosed repeating frame.
You can also create a repeating frame manually in the Paper Layout view.
Creating a frame or repeating frame
To create a frame or repeating frame manually:
1. In the Paper Layout view, click the Frame tool or the Repeating Frame tool in the tool palette.
2. Click and drag a rectangle.
Note: The size of the rectangle must be large enough to include the objects that it will contain.
3. Double-click the new frame object.
4. In the Property Inspector, set the desired properties
About frame and repeating frame sizing
For each object or record, a frame or repeating frame’s size can be expandable, contractible, variable, or fixed (specified by the Horizontal Elasticity and Vertical Elasticity properties). For example, you can set the properties to specify that it should be fixed in size horizontally, but expand vertically if a record requires more space.In the figure below, notice that there are four records for department 20, but only one record each for departments 10 and 30. The repeating frame has expanded vertically to accommodate department 20′s additional records.
Figure Repeating frame sizing
Fields
Fields are placeholders for parameters, columns, and such values as
the page number, current date, and so on. If a parameter or column does
not have an associated field, its values will not appear in the report
output. A field is owned by the object surrounding it, which is the
first enclosing object (either a frame or repeating frame).
When you default the layout for a report, Reports Builder generates
one field for each column, and places each field inside of a repeating
frame. You can also create a field manually in the Paper Design view,
Paper Layout view or Paper Parameter Form view.
Note: If you create a field object in a template,
the field is renamed when the template is applied to a report. For
example, if you create a field named F_1, the field is renamed
toF_1_SEC2 when the template is applied to a report. Thus, if you
reference F_1 in boilerplate (&F_1), these references will need to
be updated.
About Parameter Form fields
Fields in the Paper Parameter Form view act as placeholders for parameters. They define the formatting attributes for the parameters displayed in the Runtime Parameter Form. By default, one field is created for each parameter that you select in the Parameter Form Builder.Creating a field object
To create a field object manually in the report layout:
1. In the Paper Design view, Paper Layout view, or Paper Parameter Form view, click the Field tool in the tool palette.
2. Click and drag a rectangle.
3. Double-click the new field object.
4. In the Property Inspector, under the Field node, set the
Source property to the column or parameter that will provide the value
for the field.
5. Set other properties as desired
Referencing a field in boilerplate text
To reference a field in boilerplate text:
1. In the Paper Design view or Paper Layout view, click in the
boilerplate text where you want the reference to a field to appear.
2. Type an ampersand (&) followed by the name of the field.
If you want to place the field reference in front of other text
with no spaces in between, enclose the field name in angle brackets to
separate it from the text (for example,
&<
fieldname>Oracle
). If the field reference follows other text, no angle brackets are needed (for example, Oracle&
fieldname).
You can include field references right next to each other with no
spaces in between and without angle brackets (for
example, &field1&field2&field3).
Note
· A reference to a field includes the field’s properties.
Therefore, if the Horizontal Elasticity property is set to Fixed, any
extra spaces in the field will appear in the report output. For example,
if field
f_sal
is fixed horizontally, $&<f_sal>/week
may produce $800/week
in the report output.
· In addition to referencing fields in a boilerplate text
object, you can directly reference a database column (for example,
&SAL
). For example, $&<SAL>/week
may produce $800/week
in the report output.
Boilerplate
A boilerplate object is any text, lines, or graphics that appear in a report every time it is run.
Reports Builder creates one boilerplate object for each label selected in the Report Wizard (it is named B_columnname).
For example, if a column is named ENAME, a boilerplate object
containing ENAME is generated for the column. For some report types,
Reports Builder also generates lines under the labels.
You can also create a boilerplate objects manually in the Paper
Design view, Paper Layout view, or Paper Parameter Form view using any
of the following tools in the tool palette:
- Arc tool
- Ellipse tool
- File Link
- Freehand tool
- Line tool
- Polygon tool
- Polyline tool
- Rectangle tool
- Rounded Rectangle tool
- Text tool
Different Page Selection in Report Layout
Report sectioning enables you to define multiple layouts in the same report, each with a different target audience, output format, page layout, page size, or orientation.
we can define up to three report sections, each with a body area and a margin area: the names of the sections are : Header, Main, and Trailer. By default, a report is defined in the Main section. In the other sections, you can define different layouts, rather than creating multiple separate reports. If you wish, you can use the margin and body of the Header and Trailer sections to create a Header and Trailer page for your reports. In the Object Navigator, the report sections are exposed in the Object Navigator under the Paper Layout node as Header Section, Main Section, and Trailer Section. You can specify the order in which the three sections of a report (Header,Main, and Trailer) are formatted using SRW.SET_FORMAT_ORDER or the Format Order of Sections property. This capability allows Oracle Reports to format any section first to create information that is only known at the time of formatting, such as page numbers, then use that information in the formatting of another section. As an example, this property can be used to create a table of contents. For an example of using SRW.SET_FORMAT_ORDER for this purpose,
Report sectioning enables you to define multiple layouts in the same report, each with a different target audience, output format, page layout, page size, or orientation.
we can define up to three report sections, each with a body area and a margin area: the names of the sections are : Header, Main, and Trailer. By default, a report is defined in the Main section. In the other sections, you can define different layouts, rather than creating multiple separate reports. If you wish, you can use the margin and body of the Header and Trailer sections to create a Header and Trailer page for your reports. In the Object Navigator, the report sections are exposed in the Object Navigator under the Paper Layout node as Header Section, Main Section, and Trailer Section. You can specify the order in which the three sections of a report (Header,Main, and Trailer) are formatted using SRW.SET_FORMAT_ORDER or the Format Order of Sections property. This capability allows Oracle Reports to format any section first to create information that is only known at the time of formatting, such as page numbers, then use that information in the formatting of another section. As an example, this property can be used to create a table of contents. For an example of using SRW.SET_FORMAT_ORDER for this purpose,
Margin Section
To create an object or heading in the margin of a report:
1. In the Paper Layout view, click the Edit Margin button in the toolbar.
Note: The margin area is defined by a thick black line that
separates it from the body. If you create objects in the body portion of
a report while displaying the margin area, you can only edit those
objects when the margin is displayed.
2. To adjust the margin, click the margin border, then drag a
handle to the desired position. You can adjust the margin on all four
sides of a report.
3. Create required objects in the margin area. They will appear on all pages of the report.
4. Click the Header Section, Main Section, or the Trailer
Section buttons in the toolbar to reactivate the appropriate section of
the body area of the report.
Trailer Section
Creating a header page or trailer page object
With report sectioning, Header and Trailer pages are identical to Body pages. In effect, this means that the Header, Trailer, and Body are three sections of a report. The names of the sections are exposed under the Paper Design node in the Object Navigator asHeader Section, Main Section, and Trailer Section. You can use the margin and body of the Header and Trailer sections to create a Header and Trailer “page” as in earlier releases of Oracle Reports.
1. In the Paper Layout view, click the Confine Off button and the Flex On button in the toolbar.
2. Click the repeating frame for the page, then drag and
resize the frame to allow enough room to type the header or footer text.
3. Create a boilerplate text object for the header or footer text.
No comments:
Post a Comment