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 |
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.
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.