ActiveReports 12 Server User Guide
Adding a New Logical Table (Entity)
ActiveReports 12 Server User Guide > Managing Models > Model Editor Overview > Adding a New Logical Table (Entity)

You can create and add a new logical table to a model, or base a new one on an existing entity from the list.

To create a new logical table (entity)

Follow these steps to create a new entity using a SQL query.

Create a new entity from a query

  1. In the Models list, select the model that you want to edit and then click Edit model button. The model editor appears.

  2. In the model editor that appears, in the Entities list on the left, click Add. The New Entity dialog appears.

  3. In the New Entity dialog, enter a Name for the new entity. This value appears in the list of entities for the model.
  4. In the Description box, enter a description that provides users with additional information about the entity, such as when it is appropriate to use it.
  5. In the Query box, define the entity with a SQL query that pulls the data that you want.
  6. Check your query using the commands above the preview box.
    • Validate verifies the query and displays any errors it finds in red at the top of the dialog.
    • Preview Schema populates a table with information pulled by the query (column name, size, data type, and is nullable).
    • Preview Data populates a table with a sampling of the data pulled by the query.

  7. Click OK to add the new logical table to the model as a new entity.
    Note: In the Entities pane, when you select an entity that you created, an Edit command appears next to the Add command at the top of the pane. Click Edit to re-open the New Entity dialog and make changes to the name, description, or query.
  8. In the Model Editor toolbar, click the Save & Publish button to save the changes. The new logical table is added to the model and displayed in the Entities list.

Base a new entity on an existing logical table

Follow these steps to select an existing logical table to use as a new entity.

Base a new entity on an existing logical table

  1. In the Entities pane to add an existing entity, click Add. The New Entity dialog appears.

  2. To the right of the Query box, click the ellipsis button.

  3. In the Select an Existing Table dialog that appears, select the table that you want and click OK. The Query box in the New Entity dialog is populated with the table name, for example _Expenses, and the Name box is populated with the user friendly table name, for example Expenses.
  4. You can check your results using the commands above the preview box.
    • Validate verifies the query and displays any errors it finds in red at the top of the dialog.
    • Preview Schema populates a table with information pulled by the query (column name, size, data type, and is nullable).
    • Preview Data populates a table with a sampling of the data pulled by the query.
  5. In the Description box, enter a description that provides users with additional information about the entity, such as when it is appropriate to use it.
  6. Click OK to add the new logical table to the model as a new entity.
  7. In the Model Editor toolbar, click the Save & Publish button to save the changes. The new logical table is added to the model and displayed in the Entities list.
See Also