Stationery Customisation
Stationery Customisation
Opera is a trademark of Micros Systems, Inc. On Oracle and the On Oracle logo are trademarks of
Oracle Corporation.
Micros Systems, Inc. makes no warranty of any kind with regard to this material, including but not
limited to the implied warranties of marketability and fitness for a particular purpose.
Micros Systems, Inc. shall not be liable for errors contained herein or for incidental or consequential
damages in connection with the furnishing, performance, or use of this material.
David Arland
Micros-Fidelio Asia Pacific
13 Narabang Way
Belrose NSW 2084
Voice: +61294851000 Fax: +61294851099
MICROS-Fidelio
2640 Golden Gate Parkway, Suite 211
Naples, FL 34105
Voice: (941) 643-7999 / Fax: (941) 643-7911
Oracle Report Writer User Guide
Table of Contents
Property Management System and Quality Management System ........................................ 1
Introduction ............................................................................................................... 4
Editing Text Files ......................................................................................................... 5
Report Groups ............................................................................................................ 6
Report Writer Interface ................................................................................................ 7
Data Model.............................................................................................................. 8
Stationery Views .................................................................................................... 10
Layout Model ......................................................................................................... 11
Object Properties.................................................................................................... 12
Adding an Object.................................................................................................... 13
Object Alignment ................................................................................................... 13
Framing ................................................................................................................ 15
Two Methods for Adding a Field ................................................................................ 16
General Layout ...................................................................................................... 17
Moving Objects ...................................................................................................... 18
Layout Options....................................................................................................... 18
Conditional Formatting ............................................................................................... 19
Format Trigger....................................................................................................... 22
Formula Columns ...................................................................................................... 24
Column Size .......................................................................................................... 26
Exception handling in Formula Columns ..................................................................... 27
Promotional Text – Dynamic Read from External Files..................................................... 29
Dynamic File Name for Promotional Text.................................................................... 31
Inserting the Hotel Logo ............................................................................................. 33
HTML Confirmations................................................................................................... 35
Scrolling Text ........................................................................................................ 35
Compiling a Report to a Runtime File............................................................................ 36
Multiple Application Servers ..................................................................................... 36
REP_GEN Library ....................................................................................................... 37
Registration Card Configuration ................................................................................... 38
Sample Registration Card Format ............................................................................. 39
Confirmation Letter Configuration ................................................................................ 41
Using a Calculated Field (Formula Column) ........................................................ 44
Guest Folio ............................................................................................................... 47
On Line Help............................................................................................................. 50
Introduction
Opera stationery items, such as guest folio and registration cards are created using the Oracle
Report Writer tool. In principle, all stationery items produced by Opera are a report generated
from within the application.
In order to be able to create or modify stationery you need to have the Oracle Developer 2000
Reports Builder application installed on your PC. Most commonly, only Oracle Developer 2000
reports runtime files would be installed on a client, enabling an end-user to run existing
reports and stationery items.
The report builder application file is RWBLD60.EXE and would usually reside in a folder similar
to D:\oracle\dev6i\bin
Oracle report files have one of two file extensions that identify them:
RDF: Report Definition File
REP: Report Runtime File
The RDF file contains the source and definition of the report format and can be accessed using
Report Builder and modified as required. Once finalized, it is compiled into an REP for runtime
use by the application. A REP is a read only, compiled file that cannot be modified.
If local runtimes are used, a copy of the updated REP file must be copied to the local
\micros\opera\production\runtimes folder.
Stationery items will be assigned to various report groups. To locate or create a stationery
item you need to select the application report group from the list of values on the form.
To modify the definition of a stationery item, select the Edit button and then the Layout
button. (Via thick client only)
This will launch Oracle Report Builder and open the associated RDF for the REP referenced.
Report Groups
Opera requires that the stationery items be located in specific reporting groups, in order for
the application to select the correct file to use for the stationery item.
It is not necessary for the file to have a specific name, only that it exist in the correct report
group.
These groups should not be deleted or renamed and should be marked No for the Can be
Run Separately setting, as they are not a standard report that can be run from the
application
The Oracle Report Writer uses a multiple window interface, allowing more than one window to
be open and overlapped within the application. The interface consists of two primary windows:
the Object Navigator window and the Report Layout window as shown in Figure 1. The Object
Navigator uses an Explorer tree-like interface which can expand and contract to display or hide
sub options; if not displayed it can be tiled in the window by pressing [F3].
Other windows or views are also available. These allow access to the Data Model Definition or
Live Preview window. These can be selected from either the Object Navigator as shown in
Figure 2 or the Toolbar as shown in Figure 3.
To access the Data Model window, select it from the Object Navigator, or from the Toolbar as
shown in Figure 4.
A view can be defined as a combination of several tables made to appear as a single table for
ease of reference; the internal relationships, which define the joins betweens the tables, are
hidden from the user.
To view the definition of a query block, double click with the mouse over the query object as in
Figure 6.
This will display the query statement for the data object.
In this example, the statement is selecting all fields in the FOLIO_HEADER view, indicated by
the asterix. These fields are then displayed in the Data Model window shown in Figure 8.
With each major release, changes to specific views may occur, such as the addition of a
standard field. In order to be able to include these changes on your layout, you may need to
have to manually alter the query object if the query is explicitly selecting certain fields from
the view.
For example, a standard field VOUCHER is added to the view. Before being able to reference
VOUCHER in the stationery layout, you would need to modify the query SELECT statement and
add VOUCHER to the data object.
If the query is defined to select all columns (SELECT * FROM <TABLE>) then any change to the
columns in the view will automatically be included in the data object.
Figure 8 Query Field List
These fields can then be referenced and placed on the Layout Model of the report, where
required.
Stationery Views
Item Database View For Data Model Item Database View For Data Model
Guest Folio FOLIO_HEADER Guest REP_GUEST_MESSAGES_VIEW
FOLIO_DETAIL_VIEW Message
FOLIO_CREDIT_CARD_LIST
FOLIO_FOOTER
FOLIO_TAX_DETAILS
AR Folio AR_FOLIO_DETAIL_VIEW Group Folio GRP_FOLIO_DETAIL
AR_FOLIO_LIST RESERVATION_GENERAL_VIEW
AR_FOLIO_HEADER GRP_FOLIO_FOOTER
FOLIO_H_PASSERBY
Passer By FOLIO_H_PASSERBY Exchange FIN_CASHIER_REP
Folio FOLIO_DETAIL_VIEW
FOLIO_CREDIT_CARD_LIST
FOLIO_FOOTER
FOLIO_TAX_DETAILS
Confirmation CONFIRMATION_GENERAL_VIEW Register CONFIRMATION_GENERAL_VIEW
s Card
AR AR_REMINDER_HEADER Expense EXP_FOLIO_DETAIL
Reminders AR_REMINDER_DETAILS Folio RESERVATION_GENERAL_VIEW
AR_REMINDER_FOOTER EXP_FOLIO_FOOTER
AR AR_REMINDER_HEADER, Commission TA_CHECK_DETAIL
Statement AR_STATEMENT_DETAILS Check
Deposit FOREIGN_CURRENCY
Receipt FINANCIAL_TRANSACTIONS
Paid Out FINANCIAL_TRANSACTIONS Pay Receipt FINANCIAL_TRANSACTIONS
Layout Model
The Layout Model can be accessed from the Toolbar or the Object Navigator.
The layout is created using frames, lines, labels and field objects in the required locations.
Frames are used to define boundaries and establish the source of the data, for a specific
region of the report. In the case of the GSTFOLIO, four data sources exist:
Object Properties
An object’s properties can be accessed and modified using the property palette option. Using
the context sensitive menu (right click) or pressing F4 will display the property palette. Once
selected with the mouse, small handles around the other edge of the object appear which can
be used to resize or reshape an object.
The tool palette to the left of the window allows you to add various objects to the
Report Layout. These include lines, boxes, label text, fields and frames.
Select the label object, then move the cross hair cursor on the layout window
and with the left mouse pressed, drag a line vertically or horizontally.
Select the label object, then move the cross hair cursor on the layout window
and with the left mouse pressed, drag an area to define the location of the new
label/text.
Select the field object , then move the cross hair cursor on the layout window
and with the left mouse pressed, drag an area to define the location of the new
field. Once defined on the Layout Model, the properties can be modified to think the
object to a field in the Data Model.
The T displayed shows the currently selected format of the background, border and
foreground colors.
Select the paint-can objects to alter the fill, border or text color. To alter existing
objects, you must first select them. All new objects created will inherit the
properties for color currently selected.
It is also possible to copy and paste, or cut and paste objects on the Layout Model, using
options from the edit menu or standard Windows® keyboard shortcuts.
Object Alignment
There are also tools, on the Arrange menu, for aligning objects. Holding the Shift key and
selecting with a mouse click can select multiple objects at once.
Looking at the properties for each section’s frame, you can determine the various settings of
the object. There are two types of frames that can be used: a Standard and Repeat frame. A
Repeat frame is required if the Data Model will return multiple records from a single query. In
the case of the folio, for example, one reservation record could have several financial
transaction records. A Repeat frame is used to contain an area of the report in which the
transaction detail can print and repeat, for each associated financial transaction record for the
reservation.
To add a frame to the layout, use one of the tools. The arrow indicates a repeating
frame. The source of the data for a repeating frame would be a query in the Data Model, as
shown in Figure 15.
Figure 18 Frame Source
The source property identifies the location of the data for this frame; all objects contained
within this frame will need to exist in the applicable Data Model object.
The same applies to the source for each field added to the Layout Model. The field balance is
added to the Footer section of the report – it is a child object of the Footer frame. Selecting
the properties of this field we can attach it to display/print the balance or balance in words.
Repeating frames also have other important properties, such as the number of records per
page. If 0, the frame will repeat to fill the page, if possible. Any subject frames or objects will
be pushed to the second page. With predefined stationery, it may be important to restrict the
printing to only 10 or 15 records for example.
1. Select the Field icon and move the cross hair to position for field on the Layout Model.
2. Drag the area to define the field location.
3. Access properties F4 and link the field source to the field in the Data Model.
4. Change the object name to something meaningful (default F_1).
Text Object
An alternative is to reference a field using a Label Object, prefixed with the ampersand (&)
character. Using the text tool [T] on the tool palette, you can reference a field directly
prefixed with an ampersand (&). This is referred to as a Merge Code, for our purposes.
In nearly all cases, merge codes can be used. These are added to the Layout Model using the
text object. .
General Layout
For the folio, there is the requirement that the supplement and reference fields are fixed in
length, to ensure they do not extend and push out the columns to the right. An object has
properties for horizontal and vertical elasticity. The value of these properties can be set as
described below:
Contract Means the size of the object decreases, if the formatted objects or data
within it are short enough, but it cannot increase to a size greater than that
shown in the Report Editor. Truncation of data may occur; look at the
examples. (You can think of this option as meaning "only contract, do not
expand.")
Expand Means the size of the object increases, if the formatted objects or data
within it are tall enough, but it cannot decrease to a size less than that
shown in the Report Editor. (You can think of this option as meaning, "only
expand, do not contract.")
Fixed Means the size of the object is the same on each logical page, regardless of
the size of the objects or data within it. Truncation of data may occur.
Variable Means the object may expand or contract in size to accommodate the
objects or data within it (with no extra space), which means the size shown
in the Report Editor has no effect on the object's size at runtime.
If working with predefined stationery, it may be necessary to set the properties of all objects
to fixed and size them accordingly to fit the pre-printed areas of the folio. This will prevent the
object from increasing in size and going out of the defined area.
Moving Objects
It is possible to move objects using different methods. Click to select an object and drag with
the mouse to the desired position.
Click to select an object and move with the cursor keys, this can more accurate. The degree of
precision is determined by setting a user preference within Format>Layout
Options>Rulers>Snap points per grid spacing to a value of 256
Layout Options
Within Format>Layout Options>Layout Model, you can define a preference for the display
of the Layout Model. It may assist you to display a frame around each field, label and frame.
Within the Layout Mode of Oracle Report Writer, you are able to add a text object with the T
tool. Drag an area on the report and enter your label text.
To define that this label (text) object should only be displayed for specific conditions you need
to access the object’s properties palette through the context menu (right click) or by pressing
[F4].
Figure 25 Context Menu [F4]
The Conditional Formatting property will allow you to define the formatting for this object
based on specific conditions.
One of these formatting options is to hide the object completely. Select the … button to
activate the Condition Wizard.
Figure 27 Format Condition Wizard
Selecting New will allow you define a new format condition.
The function B_7FormatTrigger will return to the report a True (Display it) or False (Hide it)
value.
For example, there may be a requirement to add a merge code to generate a dynamic
paragraph based on the value of another field.
This is achieved using a formula column field. From within the Data Model, ensure the tool
palette is visible by selecting View>Tool Palette.
From the tool bar, select the formula column icon. If the tool bar is not displayed within
the Data Model window, select View>Tool Palette from the menu bar.
Moving the cross hair cursor over the data block and dragging an area within the data block
creates a new field, CF_1.
By default, the data type of the field is numeric; this can be changed by accessing the
property palette for the field using F4.
The object name can also be changed to something meaningful when used in the Layout
Model.
Object (field) name changed to
something meaningful.
Note: All calculated fields should be given a name starting with CF_
It is then easy to determine, within the layout model, that this field
is non-standard and has been added to the data model specifically.
Once painted onto the Layout Model, of the registration card, this will print for applicable
guests.
Calculated fields can be added to Confirmation Letters, Registration Cards etc, to enhance the
presentation and personalization of stationery items.
Column Size
When defining any formula column it is necessary to define the size of the column. This
ensures enough memory is reserved within the software to hold the return value from the
function.
Care should be taken to ensure the returned value does not exceed the defined size of the
column.
For a profile name of Mr David Arland, this function would return a string ‘Mr D. Arland’
However in the event that the guest name was “Arnold Schwarzenegger‘ this function would
result in an (overflow) error, as the returned value is greater than 15 characters.
If the RATE_CODE equals ‘HOLIDAY’ the function would not know what to return and would
result in an unhandled exception.
This can be corrected using an else clause in the IF statement to return NULL for any other
circumstance.
Alternatively or in addition to the else clause the no_data_found exception can be added to
return some value in the event an exception occurs during execution of the code.
To provide a solution to this requirement, it is possible to configure a formula column that will
read an external text file residing in the runtimes folder. The external file can be edited using
notepad and the text updated/replaced as required. On execution of the report, the content of
the file is read into the report and displayed within the column.
Within the data model, add a new formula column using the tool and access object
properties [F4]
This code instructs the column to read a file called ‘PROMO.TXT’ from the runtimes folder.
The next step is to switch to the layout model and add the field object.
Care should be taken to ensure the field size (width) is sufficient to hold the text that exists
within the external file. Ensure elasticity is set to expand vertically, if the text should wrap to a
second or third line.
Finally create a file ‘PROMO.TXT’ containing the text to be outputted in the field and load this
file to the d:\micros\opera\production\runtimes folder.
Figure 47 External File PROMO.TXT
The contents of this file can be changed by the hotel as required without needing to amend
the RDF and recompile to a REP.
A separate file per room type could be read to include a room image within the letter
The formula column would be set to read an image file from the runtimes folder.
Figure 48 Field Properties
The field can then be added to the layout model. At runtime the function will calculate
:room_type || ‘.GIF’ to TK.GIF and read this file into the report for output.
In the Data Model, you need to add a new data object, using the formula column tool. If
the tool palette is not visible within the data model window, select View, Tools. Position the
cross hair over the Data Model window and drag an area to create the object. From the
properties of the object, change the name to CF_LOGO; change the data type to CHARACTER;
set Read From File to YES and define the file format to be IMAGE. Finally, in the PL/SQL
formula property, type return :p_resort;
Figure 51
Compile the PL/SQL function and close the properties of the field.
Toggle to the Layout Model and open the margin section of the report, using the edit
margin icon. In the top left corner, add a field using the icon and paint a square in the top
left corner. To obtain a perfect square, hold down the Shift key while dragging the mouse.
Access the properties of the object. Change the object name to F_LOGO.
Change the field source property to reference the CF_LOGO data object.
Figure 52
Finally, ensure the Fill Color is set to No Fill and the Line Color is set to No Line using the
format tools on the layout model.
Figure 53 Figure 54
You can also resize the object according to your requirements. At runtime, the report writer
reads the file \micros\opera\production\runtimes\<resortcode>.gif and places it into
the CF_LOGO object.
Scrolling Text
An example is using the <marquee> tag to create scrolling text.
Figure 56 - Layout
Additional tags can be set for font, font size and/or colour
HTML tags could also be included in any external text file read for promotional text use.
Compiling a Report to a Runtime File
Before saving, you should also do a full compile of the report by using the menu option,
Program>Compile>All or by pressing Cntrl+Shift+K. This will process any PL/SQL code
and validate the syntax.
- most commonly these type of errors are a result of not being connected to the schema.
Also ensure any externally read files, such as PROMO.TXT or <roomtype>.gif reside in
\runtimes of all clients and/or application servers.
REP_GEN Library
All Opera stationery and reports require that the REP_GEN library be attached. This library
contains common functions, used by all reports from Opera. If reports do not compile, ensure
this library is attached and/or you are connected to the database. From the Object Navigator
[F3], open the attached libraries section and ensure the REP_GEN library is linked to the
report.
If you need to attach this library file, select the icon to the left of the Object Navigator
and select Browse on the Attach Library dialog box, to locate this file in the
\Micros\Opera\Production\Runtimes folder. Highlight the file and select Open, then
Attach to link the file to the report. You can then select Yes to remove the non-portable path
from the file.
Registration Card Configuration
The guest registration card uses the CONFIRMATION_GENERAL_VIEW as the data source. The
Data Model required has been pre-configured in the sample registration card provided with the
demonstration database.
If printing to letterhead or plain paper, both the boilerplate and field objects must be added to
the Layout Model. If printing to pre-printed stationery, only the field objects need to be added
to the Layout Model.
From the Toolbar, select the Layout Model to display the Report Layout.
Field Comments
&RESORT_FULL_NAME From hotel data
&RESORT_FULL_ADDRESS From hotel data
&FULL_ADDRESS Name and address of guest
&PHONE_NO Primary phone number from profile
&ARRIVAL_DATE
&DEPARTURE_DATE
&DEPARTURE_TIME
&ROOM_RATE
&ROOM_NUMBER
&ROOM_TYPE_DESCRIPTION Converted to description
&ROOM_TYPE Code only
&CURRENCY_CODE Currency of the rate code
&NO_OF_ADULTS
&NO_OF_CHILDREN
&MULTIPLE_RATE_INFO Property for vertical elasticity needs to be set to variable, so
field can grow as required.
&SHARE_LIST
&MEMBERSHIP_INFO
&FIRST_NAME
&LAST_NAME
&TITLE
&RATE_CODE
These codes are added to the Layout Model using the icon on the tool palette.
Sample Registration Card Format
The FULL_ADDRESS field and the surrounding frame are set to variable length, indicated by
the diamonds on each end of the frame. The same requirement applies to the multiple rate
information field. The field and frame are required to expand, based on the amount of data
returned to this field, by the program.
As the same view is used as the source, for both the registration card and confirmation letters,
the same fields are available on both.
Within the primary repeat frame, which references the Q_1 data source, place label objects for
the various fields and boilerplate text required for the letter.
If the reservation type is not ‘deposit request’ then the text is hidden (ie not printed).
The following format trigger has been generated by the wizard:
You can amend this function if additional criteria need to be added. For example, only print
this paragraph if the deposit amount due field has a value.
The PL/SQL code above is determining the value of the RESERVATION_TYPE field and
returning an applicable message to print on the confirmation letter.
The next step is to include this message field on the Layout Model; after toggling to the Layout
Model, using the Toolbar icon.
Four data sources, in the Data Model of the GSTFOLIO, select information from various views:
FOLIO_HEADER, FOLIO_DETAIL_VIEW, FOLIO_CREDIT_CARD_LIST, FOLIO_FOOTER,
FOLIO_TAX_DETAILS
The four data sources are Q_HEADER, Q_DETAIL, Q_FOOTER and Q_MERCHANT_INFO.
In the Layout Model, frames are used to section the folio; each frame reference one of the
four data sources.
First, a Repeat Header frame is added to the folio. This frame is linked to the Q_HEADER data
source. Fields and labels can then added in here, available from within the Q_HEADER data
source. Both fields and merge codes have been used in the figure above; although merge
codes (using the ampersand) can be used throughout.
Note: The Oracle Report Writer will interpret any label prefixed with
an ampersand to be a field reference, rather than boilerplate text.
This frame should be set to print on all pages, in the advanced layout properties.
Next, an outer frame is added for the transaction information; within this column titles/labels
can be added for date, description, debits and credits.
Figure 71 Outer Frame
Within this frame, a repeat frame is added for the detail (repeat) line for the transactions. This
repeat frame is linked to the Q_DETAIL data source – which retrieves the transaction records.
This Repeat frame is linked to the Q_DETAIL data source through the
property palette F4 of the frame.