Softilium: goode ideas, real tools Home | Download | Order | Contact me |

Designer

Home > Software-Promoter > Software-Promoter docs > Reports designer > Designer

Designer description

FastReport is supplied with a built in report designer, which is accessed at design time by double clicking the mouse on the TfrReport component on the project form. The designer allows quick and easy access to report designing and previewing reports within the Delphi IDE. The designer was created with dockable panels (toolbars), which may be changed to suite the user taste. Information about the panels are kept in memory while using the designer, when the designer is closed the tool bar properties are written to the windows registry so the will be used when you re-enter the design window..

To use the designer for enduser runtime requirements it is necessary to place a TfrDesigner component on the underlying form in the project, or place a reference to FR_Desgn in the uses list of the project form's module. This gives the end user the ability to design and edit reports.

Using keyboard

  • Arrow keys – move to next object.
  • Ctrl + Arrowkeys - moves selected object(s) in direction of arrow.
  • Shift + Arrowkeys - increase or decrease dimension of selected object(s) in arrow direction.
  • Enter - brings up editor of selected object.
  • Del - delete selected object.
  • Ctrl + Enter - brings up memo editor of selected object.
  • Ctrl + 1..9 - sets frame thickness of selected object.
  • Ctrl + Z - undo last action.
  • Ctrl + Y - redo canceled action.
  • Ctrl + G - toggles grid on/off.
  • Ctrl + B - toggles align to grid option on/off.
  • Ctrl + F - turn object's framing off.
  • Ctrl + D - turn object's framing on.
  • Ctrl + X - cut to clipboard.
  • Ctrl + V - paste from clipboard.
  • Ctrl + C - copy to clipboard.
  • Ctrl + A - select all objects on Page.
  • Ctrl + N - create new empty report.
  • Ctrl + O - open report file.
  • Ctrl + S - save report file.
  • Ctrl + P - preview report.

Using mouse

  • Left click - in Page window selects object; in visual component palette selects object to insert – after select LeftClick over Page window inserts new object.
  • Right click – brings up context menu for selected object.
  • Double click – brings up default editor of selected object. Double click over free space on Page brings up the Page option dialog, where you may set the Page options i.e. margins, size etc.
  • Shift + left click – toggle object's selection.
  • Ctrl + left click – draws selection rectangle. All object that fits in this rectangle will be selected after you release mouse key.
  • To scale several selected objects, drag red square on the right-bottom corner of object's group.

Designer options

To set the default options for the report designer choose "Tools|Options" menu command. Here you can set grid size, report measurement units: pixels, millimeters and inches. Grid size 18 pixels corresponds to 5mm.

You can also control how the selected object appears on screen, either frame or inverse color. If Colored Buttons is turned off, then all Buttons become black-white; Editing after insertion governs the default action when inserting objects as to whether the default editor for the object appears after insertion or not. If inserting a large amount of empty rectangles turn this option off.

Snap to grid snaps objects to the nearest grid point when moving them. Note: even though screen measurements may be in units other than mm, when setting margin sizes in Page option they are still in mm.

Report options

To set Report Options choose "File|Report option" from designer's menu.

The dropdown list at the top of the dialog box lists all available printers on the system. If there is no printer available installed in your system you can select "Default printer" which allows you to use any paper dimension but it will be impossible to print. It will only allow you to work with report in the designer and make preview.

If "Select when report loaded" option is checked then printer information is stored with the report and when this report is loaded that printer will automatically be selected. If that printer is not found on the system then the windows system default printer will be selected.

The "Two pass report" option must be checked if you need to use "total pages" function in the report, i.e. print "Page xx from yy".

When you select a printer the Page window in the report designer shows the available printable area for the Page size and printer selected.

Page options

To set the page options for the current page of report, choose "File|Page options" in designer's menu, or Dblclick on an empty spot on the page.

You can select paper format from the drop-down list of paper formats supported by the current printer. If the current printer supports custom paper sizes and you select custom from the list you will be able to enter the width and height of the custom size. Any other choice uses preset sizes. You may also choose the orientation for the Page. Note All printers may not support custom paper sizes, (for example, printer driver "HP LaserJet 6L" does not support page dimensions less than 76 * 127 mm; printer driver "HP LaserJet 4L" does not support custom size at at all).

On "Margins" tab of dialog you may select whether or not to use margins and the size of the margins. If the "Don't use" option is selected, no printable area border will be shown in the designer's Page window, and all page contents will be printed correctly on any printer. But object's sizes will be not the same on different printers.

If you leave the option unchecked and have all the margin settings at zero the pageborder will reflect the maximum printable area for the selected printer. You may find some chopping when you switch between reports designed for one printer to another, particularly between ink-jet and dot matrix. Ink-jet printers usually have a smaller printable area than a dot matrix due to the way they feed the paper.

If margins is set to non-zero values, hash marked border will show in the report designer's page window. If you use dot matrix printers, pay close attention to the printable area: some dot matrix printers will not print if the object to be printed overruns the printable area, others will produce pages with the over-run printed on them. This obviously produces weird looking reports. In this case, you should set margins manually.

On the "Options" tab of the dialog you may set more options for the page. You may set the number of columns across the page width and the space between them. If "Print on previous page" flag set to true this will allow a new page to start printing on the unused space of the previous page.

Report variables

There are many reasons for the use of named Variables in reports, an example would be to create names for cryptic field names like n1 n2 n3 in an underlying data base. When looking at such names in a report design they don't make much sense it would be much better to have something like LastName, MiddleName, FirstName to insert as an object than the cryptic names.

These variables can be more than just replacements for field names; they could be mathematical expressions like sums or rounded values, dates, time, string concatenation etc.

To work with a list of variables it is first necessary to create it. To show the available variable list, choose "File|Variable list" in report designer's menu. If no variables created, left drop-down list of Variable categories will be empty and the variable list below it will be empty. The drop-down list on the right displays the available datasets and the window below shows available data fields of the selected dataset.

To create a variable list click on the "Variables" button at the bottom left of the variable List editor and the Variables list window appears as below.

In Variables list editor you should type categories and its variables in the following format:

CATEGORY1

 Variable1

 Variable2

^ space is required!

CATEGORY 2

 Variable 1

 Variable 2

etc.

You should define at least one category. When finished press Ok and you will be returned to the Variables editor.

The next step is to assign values to all created variables. To attach any variable to any data field select the variable name in the left hand list then select the desired datafield in the right hand list.

The drop-down list on the right displays the available datasets and the window below shows available data fields of the selected dataset. The last available category in the dataset drop-down list is the "Other". When selecting it, you'll get access to the following data:

  • Page# (built-in function returns current Page number).
  • Expression allows creation of expression in the "Expression" textbox.
  • Date (built in function returns current date).
  • Time (built in function returns current time).
  • Line# (built in function returns current row number of report dataset).
  • Line through# (built-in function returns row through).
  • Column# (built-in function returns Column number).
  • TotalPages (built in function returns number of pages in report). To use this function, you should set "Two-pass report" option in Report options dialog.

FR Object Inspector

The Object Inspector allows you to manipulate some object properties: set object name, it's position, dimensions and visibility. Inspector works like Delphi's Object Inspector. Like the other toolbars, it may be showed or hided. To show Object inspector, choose "Tools|ToolBars|Object Inspector" in designer's menu. To shrink Object Inspector, dblClick on its title bar; dblClick again and it will expand.

Highlightning

For those reports, which you would like to have objects change their font color, background color etc. based on a specific condition or expression, click the "Highlight" button in the Text formatting toolbar. This will bring up the "Highlight attributes" dialog where you may enter the conditions to be satisfied in the text box and select the various options available.

For example, assume it is necessary to pick out orders exceding $1,000.00, Demo report 3- level is an example of this. To achieve this, select rectangle containing sum order, click on the highlight button in the formatting toolbar. In the textbox of the dialog type the condition "Value > 1000" without quotes. Select appropriate font & background color then click Ok. Your report will now show any orders over $1000.00 highlighted with the chosen color. Try various combinations of font styles with background colors to achieve the results you need.


Prev Next
=== Documentation is provided by Word2Help ===

Copyright © 2000-2005, Nick Mokhnatov, Independent software developer. Terms of use. Privacy statement.
Updated on Sun, February 11, 2007