A report field allows you to print formatted data. So we will take a closer look at what we can do with this field. Within the 'format' tab you can select a lot of the usual format styles such as fonts, alignment, number formatting etc. In the 'frame' tab of the Property Editor you can define lines to be painted. The horizontal and vertical lines should become clear to you after you have tried them out. The diagonal lines are not so self-explanatory: "diagonalLuRo" paints from the bottom left hand corner up to the top right hand corner and "diagonalLoRu" paints from the top left hand corner down to the bottom right hand corner. Note: In case you are wondering how "diagonalLuRo" translates to bottom left to top right, it's an abbreviation from the German "Links Unten Rechts Oben" and I think you can work out "diagonalLoRu")
You will be familiar with most of the fields on the "Data" tab from using Property Editor during the creation of a form. There are two new fields:
value field
and the running count field
The value field contains the string that will be printed. There are some variables you can use. The most important variable is the already set %VALUE% variable that will be replaced with the actual data from the database column. As the field value will contain a string, any string will be valid, for example: 'Hi, my name is %VALUE% , blah bla this is the field %FIELDNAME%' is a valid string. Other possible variables are
%PAGENUMBER% the relative pagenumber: use this variable to set the number of the first page (very useful in pageheader or footersection)
%ABSOLUTEPAGENUMBER% the physical page number
%ROWNUMBER%
%DATE% the current date
%TIME% the current time
if a column is set
%COUNT%
%FIELDNAME%
%VALUE%
if the field type is numeric you can also use
%SUM%
%MIN%
%MAX%
%AVERAGE%
%STDDEV% (standard deviation)
%STDDEVSAMPLE%
With this knowledge, we can now try to format this report to make it more stylish and readable to the user. First we will create a new field that will print the static text 'My first report' at the very beginning of the report. Create this field in the reportheadersection, moving it to the upper left hand corner and resizing it to the maximum width. Now change the fontsize of this field to 24 and overwrite the content of the value field with 'My first report'. Notice that we left the column field empty.
Next we want to see the page number centred on the bottom of each page. Create a new field in the pagefootersection, moving it to the upper left hand corner and resizing it to the maximum width. Overwrite the content of the value field with 'page -%PAGENUMBER%-', set the alignment field to 'center' and in the "Frame" tab set the top line field to 'yes'.
Save the report as 'literaturereport'. We need it in a later exercise. In the following figure you can see the resulting report. The parallel double lines were created as an empty field with topline and bottom line enabled.
If the text size exceeds the width of the field, you can use the "linebreak" property. If the text exceeds the field height, you can use the "dynamic height" property. The field will then resize automatically to hold the whole text (make sure that the linebreak property is set, when the dynamic height property is set).