Modifying general report properties

This section describes the general report properties that you can modify.

Changing the report style

The general style properties for a report include:

  • The unit of measure used in the report

  • A timer interval for events in the report

  • A background color for the report

InfoMaker assigns defaults when it generates the basic report. You can change the defaults.

To change the default style properties:

  1. Position the pointer in the background of the report, display the pop-up menu, and select Properties.

    The Properties view displays with the General page on top.

  2. Click the unit of measure you want to use to specify distances when working with the report:

    • PowerBuilder units (PBUs) Normalized units

    • Pixels (smallest element on the display monitor)

    • Thousandths of an inch

    • Thousandths of a centimeter

    Choosing the unit of measure

    If you plan to print the contents of the report at runtime, change the unit of measure to inches or centimeters to make it easier to specify the margin measurements.

  3. Specify the number of milliseconds you want between internal timer events in the report.

    This value determines how often InfoMaker updates the time fields in the report. (Enter 60,000 milliseconds to specify one minute.)

  4. If the DataWindow contains buttons, set the ShowBackColorOnXP property to make sure that the background color you select for the buttons displays on systems using the XP style.

  5. On the Background page, select a background color from the Color drop-down list. The default color is the window background color.

Setting colors in a report

You can set different colors for each element of a report to enhance the display of information. 

To set a solid background color in a report:

  1. Position the mouse on an empty spot in the report, display the pop-up menu, and select Properties.

  2. On the Background page in the Properties view for the report, select Solid from the Brush Mode drop-down list and a color from the Color drop-down list.

To set a solid color for a band in a report:

  1. Position the mouse pointer on the bar that represents the band, display the pop-up menu, then select Properties.

  2. On the Background page in the Properties view, select Solid from the Brush Mode drop-down list and a color from the Color drop-down list.

    The choice you make here overrides the background color for the report.

To set solid colors in controls in a report:

  • Position the mouse pointer on the control, display the pop-up menu, then select Properties.

    You can set colors in the Background page in the Properties view.

    For controls that use text, you can set colors for text on the Font page in the Properties view. For drawing controls, you can set colors on the General or Background page in the Properties view.

Setting gradients and background pictures in a report

You can use the background effects to give the report more visual interest. For example, you can set a vertical gradient on a header band to differentiate it from the other bands in the report:

To set a gradient background in a report:

  1. Position the mouse on an empty spot in the report, display the pop-up menu, and select Properties.

  2. On the Background page in the Properties view for the report, select a type of gradient from the Brush Mode drop-down list.

  3. Select the primary (background) color from the Color drop-down list.

  4. Select the secondary (gradient) color from the Gradient group Color drop-down list.

To set a picture as the background in a report:

  1. Position the mouse on an empty spot in the report, display the pop-up menu, and select Properties.

  2. On the Background page in the Properties view for the report, select Picture from the Brush Mode drop-down list.

  3. Specify the image file in the File field in the Picture group.

  4. From the Tile Mode drop-down list, select the style you want to use.

    Selections from the drop-down list allow you to display the picture in its original size, stretch the picture in different directions, or tile multiple copies of the picture in a variety of possible patterns.

Setting transparency properties for a report

You can change the transparency settings for colors and pictures.

To set the transparency of a gradient in a report:

  1. Position the mouse on an empty spot in the report, display the pop-up menu, and select Properties.

  2. On the Background page in the Properties view for the report, locate the Gradient group.

  3. Move the Gradient group Transparency slider until the gradient (secondary) color is set to the desired transparency.

    You can see the appearance in the Design view. The more transparent the gradient color is, the more you will see the primary (background) color.

To set the transparency of a background picture in a report:

  1. Position the mouse on an empty spot in the report, display the pop-up menu, and select Properties.

  2. On the Background page in the Properties view for the report, locate the Picture group.

  3. Move the Picture group Transparency slider until the image is set to the desired transparency.

    You can see the appearance in the Design view.

Specifying properties of a grid report

In grid reports, you can specify:

  • When grid lines are displayed

  • How users can interact with the report at runtime

To specify basic grid report properties:

  1. Position the mouse pointer on the background in a grid report, display the pop-up menu, and select Properties.

  2. Select the options you want in the Grid section on the General page in the Properties view as described in the following table.

    Option

    Result

    On

    Grid lines always display

    Off

    Grid lines never display (users cannot resize columns at runtime)

    Display Only

    Grid lines display only when the report displays online

    Print Only

    Grid lines display only when the contents of the report are printed

    Column Moving

    Columns can be moved at runtime

    Mouse Selection

    Data can be selected at runtime (and, for example, copied to the clipboard)

    Row Resize

    Rows can be resized at runtime


Specifying pointers for a report

Just as with colors, you can specify different pointers to use when the mouse is over a particular area of the report.

To change the mouse pointer used at runtime:

  1. Position the mouse over the element of the report whose pointer you want to define, display the pop-up menu, and select Properties to display the appropriate Properties view.

    You can set a pointer for the entire report, specific bands, and specific controls.

  2. Select the Pointer tab.

  3. Either choose the pointer from the Stock Pointers list or, if you have a file containing pointer definitions (CUR files), enter a pointer file name.

    You can use the Browse button to search for the file.

  4. Click OK.

Defining print specifications for a report

When you are satisfied with the look of the report, you can define its print specifications.

To define print specifications for a report:

  1. In the Report painter, select Properties from the report's pop-up menu.

  2. In the Units box on the General page, select a unit of measure.

    It is easier to specify the margins when the unit of measure is inches or centimeters.

  3. Select the Print Specifications tab.

    The Print Specifications properties use the units of measure you specified on the General page.

  4. Specify print specifications for the current report.

See the following table or more information.

Setting

Description

Document Name

Specify a name to be used in the print queue to identify the report.

Printer Name

Specify the name of a printer to which this report should be sent. If this box is empty, the report is sent to the default system printer. If the specified printer cannot be found, the report is sent to the default system printer if the Can Use Default Printer check box is selected. If the specified printer cannot be found and the Can Use Default Printer check box is not selected, an error is returned.

Margins

Specify top, bottom, left, and right margins. You can also change margins in the Preview view while you are actually looking at data. If you change margins in the Preview view, the changes are reflected here on the Print Specifications page.

Paper Orientation

Choose one of the following:

  • Default: Uses the default printer setup.

  • Portrait: Prints the contents of the report across the width of the paper.

  • Landscape: Prints the contents of the report across the length of the paper.

Paper Size

Choose a paper size or leave blank to use the default.

Paper Source

Choose a paper source or leave blank to use the default.

Prompt Before Printing

Select to display the standard Print Setup dialog box each time users make a print request.

Can Use Default Printer

Clear this check box if a printer has been specified in the Printer Name box and you do not want the report to be sent to the default system printer if the specified printer cannot be found. This box is checked by default if a printer name is specified.

Display Buttons - Print Preview

Select to display Button controls in Print Preview. The default is to hide them.

Display Buttons - Print

Select to display Button controls when you print the report. The default is to hide them.

Clip Text

Select to clip static text to the dimensions of a text field when the text field has no visible border setting. The text is always clipped if the text field has visible borders.

Collate Copies

Select to collate copies when printing. Collating increases print time because the print operation is repeated to produce collated sets.

Print Preview Shows Outline

Select to display a blue outline to show the location of the margins.

Print Shows Background

Whether the background settings of the DataWindow and controls are included when the DataWindow is printed.

Preview Shows Background

Whether the background settings of the DataWindow and controls display in the print preview.

Newspaper Columns Across and Width

If you want a multiple-column report where the data fills one column on a page, then the second, and so on, as in a newspaper, select the number and width of the columns in the Newspaper Columns box. See Printing with newspaper-style columns.


Printing with newspaper-style columns

When you define a report, you can specify that it print in multiple columns across the page, like a newspaper. A typical use of newspaper-style columns is a phone list, where you want to have more than one column of names on a printed page.

Use Print Preview to see the printed output

Newspaper-style columns are used only when the report is printed. They do not appear when a report runs (or in Preview). Therefore, to see them in InfoMaker, use Print Preview in the Report painter.

To define newspaper-style columns for a report:

  1. Build a tabular report with the data you want.

  2. Select Properties from the report's pop-up menu.

  3. Select the Print Specifications tab.

  4. Specify the number of columns across the page and the width of columns in the Newspaper Columns Across and Newspaper Columns Width properties.

  5. For each control in the report that you do not want to have appear multiple times on the page (such as headers), select Properties from the control's pop-up menu and select the HideSnaked check box on the General page in the Properties view.

Example

This example describes how to create a newspaper-style report using the Employee table in the PB Demo DB.

  1. Create a tabular report, selecting the last name, first name, and phone number columns, and add a title, page number, and date.

    The Emp_Fname column and the text control holding a comma are defined as Slide Left, so they display just to the right of the Emp_Lname column.

  2. On the Print Specifications page of the report's Properties view, specify two columns across and a column width of 3.5 inches in the Newspaper Columns boxes. (Make sure that Units is set to inches on the General property page.)

  3. To view the report as it will be printed, place the pointer in the Preview view and select File>Print Preview.

    The report displays the result set in two columns. Everything above the column headers (which includes page number, title, and date) also shows twice because of the 2-column specification. This information should appear only once per page.

  4. To specify that page number, title, and date appear only once on the page, you need to suppress printing after the first column. For each of these controls, select Properties from the control's pop-up menu. Then set the HideSnaked property.

    The finished report has one set of page heading information and two columns of column header and detail information.

Modifying text in a report

When InfoMaker initially generates the basic report, it uses the following attributes and fonts:

  • For the text and alignment of column headings and labels, InfoMaker uses the extended column attributes made in the Database painter.

  • For fonts, InfoMaker uses the definitions made in the Database painter for the table.

You can override any of these defaults in a particular report.

To change text in a report:

  1. Select the text.

    The first box in the StyleBar is now active.

  2. Type the new text.

    Use ~n~r to embed a newline character in the text.

To change the text properties for a text control in a report:

  1. Select the text control.

  2. Do one of the following:

    • Change the text properties in the StyleBar.

    • Select the Font page in the control's Properties view and change the properties there.

Naming controls in a report

You use names to identify columns and other controls in filters and in InfoMaker expression functions.

The Report painter automatically generates names for all controls in a report. To name columns, labels, and headings, the Report painter uses database and extended attribute information. To name all other controls, it uses a system of prefixes. You can control the prefixes used for automatic name generation and you can specify the name of any control explicitly.

To specify prefixes for naming controls systematically in a report:

  1. Select Design>Options from the menu bar and then select the Prefixes tab.

  2. Change prefixes as desired and click OK.

To specify a name of a control in a report:

  1. Select Properties from the control's pop-up menu and then select the General tab in the Properties view.

  2. Type the name in the Name box.

Using borders in a report

You can place borders around text, columns, graphs, and crosstabs to enhance their appearance. InfoMaker provides six types of borders: Underline, Box, ResizeBorder, ShadowBox, Raised, and Lowered:

Border appearance varies

Changing the border style may not have the same effect on all Windows operating systems and display settings.

To add a border to a control in a report:

  1. Select one or more controls.

  2. Select the border you want from the Border drop-down toolbar in the PainterBar.

    InfoMaker places the border around the selected controls.

    You can also specify a border for one or more controls in the Properties view on the General page.

Specifying variable-height bands in a report

Sometimes reports contain columns whose data is of variable length. For example, a Memo column in a table might be a character column that can take up to several thousand characters. Reserving space for that much information for the column in the detail band would make the detail band's height very large, meaning users could see few rows at a time.

The detail band can resize based on the data in the Memo column. If the Memo column has only one line of text, the detail band should be one line. If the Memo column has 20 lines of text, the detail band should be 20 lines high.

To provide a band that resizes as needed, specify that the variable-length columns and the band have Autosize Height. All bands in the report can be resized, but nested report overflow is supported only in the Detail band. If autosizing would preclude the display of at least one Detail band row per page, other bands cannot be autosized. Autosizing is not supported with the Graph, RichText, OLE, or Label presentation styles.

To create a resizable band in a report:

  1. Select Properties from the pop-up menu of a column that should resize based on the amount of data.

  2. Select the Autosize Height check box on the Position page.

  3. Clear the Auto Horizontal Scroll check box on the Edit page.

    InfoMaker wraps text in the Preview view instead of displaying text on one scrollable line.

  4. Repeat steps 1 to 3 for any other columns that should resize.

  5. Select Properties from the band's pop-up menu.

  6. Select the Autosize Height check box on the General page.

    In the Preview view, the band resizes based on the contents of the columns you defined as having their height sized automatically.

Using the RowHeight function with Autosize Height

When a detail band has Autosize Height set to "true", you should avoid using the RowHeight InfoMaker expression function to set the height of any element in the row. Doing so can result in a logical inconsistency between the height of the row and the height of the element. If you need to use RowHeight, you must set the Y coordinate of the element to 0 on the Position page in the Properties view, otherwise the bottom of the element might be clipped. You must do this for every element that uses such an expression. If you move any elements in the band, make sure that their Y coordinates are still set to 0.

You should not use an expression whose runtime value is greater than the value returned by RowHeight. For example, you should not set the height of a column to rowheight() + 30. Such an expression produces unpredictable results at runtime.

Clipping columns

You can have Autosize Height columns without an Autosize Height detail band. If such a column expands beyond the size of the detail band in the Preview view, it is clipped.

Modifying the data source of a report

When modifying a report, you might realize that you have not included all the columns you need, or you might need to define retrieval arguments. You can modify the data source from the Report painter. How you do it depends on the data source.

Modifying SQL SELECT statements

If the data source is SQL (such as Quick Select, SQL Select, or Query), you can graphically modify the SQL SELECT statement.

To modify a SQL data source:

  1. Select Design>Data Source from the menu bar.

    InfoMaker returns you to the SQL Select painter. (If you used Quick Select to define the data source, this might be the first time you have seen the SQL Select painter.)

  2. Modify the SELECT statement graphically using the same techniques as when creating it.

    For more information, see Using SQL Select.

    Modifying the statement syntactically

    Select Design>Convert to Syntax from the menu bar to modify the SELECT statement syntactically.

  3. Click the Return button to return to the painter.

Changing the table

If you change the table referenced in the SELECT statement, InfoMaker maintains the columns in the Design view (now from a different table) only if they match the datatypes and order of the columns in the original table.

Modifying the retrieval arguments

You can add, modify, or delete retrieval arguments when modifying your data source.

To modify the retrieval arguments:

  1. In the SQL Select painter, select Design>Retrieval Arguments from the menu bar.

    The Specify Retrieval Arguments dialog box displays, listing the existing arguments.

  2. Add, modify, or delete the arguments.

  3. Click OK.

    You return to the SQL Select painter, or to the text window displaying the SELECT statement if you are modifying the SQL syntactically.

  4. Reference any new arguments in the WHERE or HAVING clause of the SELECT statement.

    For more information about retrieval arguments, see Defining Reports

Modifying the result set

If the data source is External or Stored Procedure, you can modify the result set description.

To modify a result set:

  1. If the Column Specification view is not open, select View>Column Specifications from the menu bar.

  2. Review the specifications and make any necessary changes.

If the data source is a stored procedure

If you are modifying the result set for a report whose data source is a stored procedure, the pop-up menu for the Column Specification view contains the menu item Stored Procedure.

Select Stored Procedure from the Column Specification view's pop-up menu to edit the Execute statement, select another stored procedure, or add retrieval arguments. For more information about editing the Execute statement, see Using Stored Procedure.