Topics: Hands-On
05: Display items, Summary and Function columns
Perform the
following:
1- Modify the
"Items" tab canvas layout to generate a new item called "itemtotal". This
field will be populated from other “Item” table’s column during order entry.
(quantity * actualprice)
2- Add a display
field to calculate the grand total of all calculated field call "itemtotal"
for each customer's order.
In this Hands-On,
you will learn how to: display fields, summary and formula functions.
|
More Resources by
Google: |
|
|
|
|
Save the Form name
as version 05.
Go to the “Items”
tab and move the “itemtot” column and scrollbar to right.
The “Block” box
should be the "item" block.
Select “Display
item” and click the cursor next to the “quantity” item.
Adjust its size.
And open its property palette.
Change “name” to
itemtotal.
Change
“Justification” to right.
Change “Datatype”
to Number.
And its “format
mask.”
Change "Calculation
Mode" to Formula, and type the formula on the “Formula” box. The colon next to
an item, references to a binding variable on the screen such as actualprice and
quantity.
Change "database
item" to no, because this is not a column from the item table.
Change "prompt" to
"itemtotal.”
Change "Prompt
attachment edge” to “Top.”
Then close the
window.
Check the changes.
Add another
"Display Item" to calculate the totals of “itemtotal.”
Notice that the
“Block” box on the canvas window points to the “item” block. And the “Number of
Items Displayed” on this object is 5.
Open it's property
palette.
Change the name.
Change
“Justification” to “Right.”
Change “Data Type”
to “Number.”
Change “Calculation
Mode” to “Summary.”
Here, the formula
property is not applicable.
Change “Summary
Function” to “SUM.”
Change “Summarized
block” to “Item.”
Change “summarized
Item” to itemtotal.
Change “Number of
items displayed” to 1.
Change “Database
item” to “no.”
Type the prompt
property.
Change “Prompt
attachment edge” to “Start.”
Then, close the
window.
Make some window
adjustments.
Open the item “data
blocks” property palette.
Change "Query all
records" to "yes."
Close the window.
Navigate the
application's layout.
Then run the
application.
Click “Execute
query” and navigate through the application.
Notice that the
itemtotal column matches with the itemtot column.
There is no “Format
mask” for the “order total” item.
Close the window,
Open the order
total property palette.
Change its format
mask.
Close the window
and run the application.
Execute the query
and navigate through the application.
When you are done
with all your testing, then close the application and save the changes.
Now, you should
practice this over and over, until you become a master at it.
Good Luck.
|