Specifications

Four examples
636 InfoMaker
Example 3: creating a row indicator
This example demonstrates the use of several functions: Bitmap, Case,
CurrentRow, GetRow, and RGB.
The example is presented in the DataWindow painter, which is the same as
InfoMaker’s Report painter. You can use all the functions shown in the
example in the Report painter. However, because you can change the current
row and change data in a DataWindow object (which you cannot do in a
report), the example is more interesting to consider in a DataWindow object.
What you want to do
Using the Employee table in the Enterprise Application Sample Database, you
create a DataWindow object using the Emp_id, Emp_fname, Emp_lname, and
Salary columns.
In the painter, you want to display a number of items such as the number of the
current row, an arrow that is an indicator of the current row, and the salary for
an employee with a background color that depends on what the salary is.
How to do it
In the workspace, add the following:
A computed field CurrentRow( ), which displays the number of the current
row.
A picture object, which is a right-arrow, for which you define an
expression for the arrow’s visible property:
If(CurrentRow()= GetRow(), 1, 0)
The expression causes an arrow to display in the current row and no arrow
to display in other rows.
A computed field using the
If, CurrentRow, and GetRow functions:
If(CurrentRow() = GetRow(),"Current","Not current")
displays the word “Current” when the row is the current row and “Not
current” for all other rows.
A computed field (typed on one line) using the
Bitmap, CurrentRow, and
GetRow functions:
Bitmap(If(CurrentRow()= GetRow(),
"c:\sampl\ex\code\indicatr.bmp", " "))
displays an arrow bitmap for the current row and no bitmap for all other
rows.