To create a RichText report:
In the New dialog box, select RichText from the Object tab and click OK.
Select data for the report as you do for any report.
If you want data to be retrieved into the Preview view automatically, select the Retrieve on Preview check box. For more information, see “Building a report”.
Specify settings for the report on the Specify RichText Settings screen, click Next, and then click Finish.
Table 16-1 describes the types of settings you can make for the RichText report in the wizard.
You can specify |
With these settings |
---|---|
Tools available |
Rich text bars: Tool, Status, Ruler, and PopUp Menu |
Whether there will be a header and footer for the printed report |
Header/Footer |
Whether you are prevented from editing input fields and text |
Display Only |
Colors for the whole background and the background of input fields |
Background Color: General and Input Field |
After you click Finish in the wizard, you see input fields with their labels in the detail band in the Design view:
You can:
Begin editing text in the detail, header, or footer bands, building a report around the input fields. You can delete, move, copy, and paste text and input fields as needed.
Include a rich text file you have already prepared. If you include a rich text file created in PowerBuilder that contains input fields, those names should match the columns selected in the report.
Add computed fields that will appear as input fields in the report and whose values come from the computed field expression.
This sample shows how you might rearrange the input fields in a sales letter:
You can add text by typing directly in the Design view. You do not have to create text objects as you do for other report styles. The Report painter’s StyleBar lets you apply formatting to selected text. The RichText toolbars are not available in the painter.
Preview mode and editing text You cannot edit text in the Preview view, but you can edit it when you preview the report by selecting File>Run/Preview from the menu bar. It may seem convenient to edit text in Preview mode because the toolbars are available. However, any changes you make to the text when previewing are temporary. They are discarded as soon as you return to the Design view.
If you have a rich text file, you can include it in the report. In the Design view, you can insert text from a file into the detail, header, or footer band.
To insert a file:
Click in the text in any band to set the insertion point for the file.
Right-click in the Design view and select Insert File from the pop-up menu.
In the file selection dialog box, select the file you want to insert.
Only the body of the file is used. If the file has a header or footer, it is ignored.
You decide whether your RichText report has a header and footer by checking Header/Footer in the wizard or Rich Text Object dialog box (described in “Formatting for RichText objects within the report”). The decision to include a header and footer must be made at design time; it cannot be changed at runtime.
To display a page number or a date in the header or footer, you can insert the predefined computed fields Page n of n or Today().