You are here:
< Back

You can get even more out of Foxfire! by creating data items when existing data items don’t retrieve the information you need. For example, suppose you wanted to create a data item that displayed the model and make of a car as one data item instead of two separate data items.

There are two types of data items:

  • Real data items. These are actual fields in the database file created by an administrator or developer.
  • Foxfire! data items. These are data items you create in Foxfire!. They will not affect your real data and are not useable anywhere outside of Foxfire! When you create a Foxfire! data item it is stored in the Foxfire! Data Dictionary.

You can only create data items from the Workbench window so we will go ahead and open a new report here. After each exercise you will cancel the Request and discard your changes. That way you are not actually creating a new Request, you are just using the Workbench to create new data items.

When you create a data item it will automatically be stored in the Foxfire! Data Dictionary. Your new data item will be available whenever you use Foxfire! but it will not affect your real data and it will not be useable anywhere outside of Foxfire!

In Lesson 8-A you will create a new data item. In Lesson 8-B you will combine two data items to make a single data item.

Lesson Goals:  You are going to create a new data item called Cars Month of Sale.


To create the new data item:

  1. From the Request Manager, create a new Detail report named TEST (title Test Report).
  2. Click the Select Data Items tab.
  3. Click Create.
  4. Enter Cars Month of Sale as the Data Item Name.
  5. Enter Cars Month of Sale (Alpha) as the Description.
  6. Select Inventory from the Data Item Group drop-down box. (Data Item Groups make it easier to find data items if there are many data items in your data dictionary.)
  7. Click the Edit button next to the Expression box to open the Expression Editor.
  8. Click on Cars Date of Sale in the Choose Item list.
  9. On the right hand side there is a box that says Choose date function. Select Month name as the date function.

  10. Click Create.The Expression Preview will say “Month name of Cars Date of Sale.” This is what the expression is in plain language.
  11. Click OK.You will now be back to the Create New Data Item screen. The expression now says (CMONTH(CARS.SALEDT)), which is the actual expression used by Microsoft FoxPro.Column Header 1 will be empty and Column Header 2 will say Cars Month of Sale.
  12. Enter “Month” in Column Header 1.
  13. Enter “of Sale” in Column Header 2.
  14. Click on the center alignment icon to the right of Column Header 1. This causes the column headers to be centered
  15. Enter March in the box that says Sample. That will be the sample value displayed in the Design Preview window.
  16. Change the Column width to 9 since the largest month is 9 characters. This is what the new data item will look like for Cars Month of Sale.
  17. Click OK. The new data item, Cars Month of Sale, appears in the Selected Items List. Cars Month of Sale will also appear in the Choose From list for any other Requests you create or modify.

Combine Data Items

Lesson Goals:  You are going to create a data item that combines Cars Make and Cars Model in a single data item.


To combine the data items into a single data item:

  1. Click Create.
  2. Enter Cars Make and Model as the Data Item Name.
  3. Enter Cars Make and Model as the Description. You must assign this item to a Data Item Group. Data Item Groups make it easier to find data items if there are many data items in your data dictionary.
  4. In the Data Item Group drop-down box, select Inventory.
  5. Click on the Edit button next to the Expression box to open the Expression Editor.
  6. Click on Cars Make in the Choose Item list in the left-hand side of the window.
  7. Select Remove trailing spaces from the Apply formatting drop-down box.
  8. Click Apply.
  9. Click Space.
  10. Click on Cars Model in the Choose Item list.
  11. Click Insert.
  12. Click OK. You will now be back to the Create New Data Item screen. The expression will be (Trim(CARS.MAKE))+” “+CARS.MODEL, which is the actual expression used by FoxPro.
  13. Enter “Make/” in Column Header 1.
  14. Enter “Model” in Column Header 2.
  15. Enter “Buick Century” in the box that says Sample. That will be the sample value displayed in the Design Preview window.
  16. Change the Column width to 25.
  17. Click OK. The new data item Cars Make and Model appear in the Selected Items List. Cars Make and Model will also appear on the Choose From list for any other Requests you create or modify.
  18. Click the Cancel icon on the Design Preview toolbar.
  19. Click No when asked if you want to save the changes you have made to this Request.