...
In the query above, the tenant ID has been specified as a property (tenantid
) in Jaspersoft Studio, and the property value is used in the query. CollectionSpace will pass in the current tenant ID when the report is run on the CollectionSpace server, so we can re-use the same report can be used for different tenants in the system. For your testing, set the tenantid
property to have a default value corresponding to the tenant you most commonly use. This id is the one specified in the tenant configuration file for the services, for your tenant. See also: Creating your new tenant.
You will also note an additional where_clause
parameter. This is used to pass in specific id values, when the report is to be run on a particular record. In the reports provided with CollectionSpace, this parameter often has a default value likesimilar to:
Code Block |
---|
(($P{csid} == null || ($P{csid}.length() == 0)) ? "" : " AND hierarchy.name = '" + $P{csid} + "'") |
The effect of this definition is to look for a csid
parameter passed in from CollectionSpace, and produce a report on that single record if it is set. If the value is not set by CollectionSpace (when the report is run without any context), the report is run on all records (of a certain type). Authoring a report this way allows it to be run either for a single record, or without a context (from the Tools/Reports screen).
...