A virtual table is one you define in the data dictionary and doesn't physically exist. When the user uses a virtual table in a report, plugin code you create is used to retrieve the appropriate data.

Virtual tables, shown as in the TreeView, are typically used to hide the complexity of an application's data structures. For example, if you have individual invoices and credit notes tables, you may wish to create a virtual table that combines records from both tables. That would make reporting much easier for the user.

To create a new table, click the Create button () when a table node is selected in the TreeView; alternatively, you can click the drop-down arrow beside the Create button and choose Create Table from the menu, or choose Create Table from the Objects or shortcut menus. If you want to create a virtual table with the same fields as an existing table, choose the Create Virtual Table from Table function. Enter the desired name for the virtual table when asked. You are prompted if you want to copy the relations for the existing table to the virtual table.

Enter the name and caption for the table, indicate whether it's reportable or not (it doesn't make much sense to create a virtual table that's not reportable), and fill in the custom properties as necessary.

A virtual table needs a plugin that specifies how to retrieve data for the virtual table. There are several built-in plugins, such as ones that retrieve data using a SQL statement or from Microsoft Excel speadsheet; see the Table Properties help topic for information on these plugins. You can also create your own custom plugin.

A virtual table can also be created automatically from a stored procedure in the database if you turn on the Create virtual tables from stored procedures option when you create a project or add a database to a project. See the Table Properties help topic for information on such virtual tables.

See Also

Creating a Calculated Field | Select | Table Properties