ActiveReports 12 Server User Guide
Ad Hoc Entities
ActiveReports 12 Server User Guide > Concepts > Logical Data Models > Ad Hoc Entities

An ad hoc entity is one that is bound to a dynamic SQL query, for example, a stored procedure or a view, rather than a query built by ActiveReports Server. You can use an ad hoc entity in the same ways as any other entity, except that you cannot add a logical column, a calculation, to the base table of an ad hoc entity. You can, however, add calculated attributes in the SQL query itself. You can also add attributes that bind to the existing columns, and you can add relations to other entities.

An example of a query that creates an ad hoc entity from the included ActiveTunes (Sample) model is as follows.

SQL Query
Copy Code

SELECT Address, City, State FROM Customer

Creating Ad Hoc Entities

Any limitations that apply to the underlying data also apply to your ad hoc entity. 

If you try to create an entity using a query that exceeds your underlying data's limits, ActiveReports Server displays an appropriate error.

Tip: When editing queries for ad hoc entities, provide all attributes that are currently used by the entity. This way, if you want to exclude an attribute from the SQL query of the ad hoc entity at run time, you can delete it before the edit operation.

Take care when changing these queries, because you can change the actual data for attributes without changing the semantic model (except the entity edits). This could cause data in some reports to change dramatically.