Available in: Logi Info | Source code name: LocalData |
LocalData sets @Local tokens that can be used throughout the report definition. The names and values for these tokens come from the columns/attributes of the first row of a DataLayer. This makes it easy to cross-reference values from Request parameters with values in a database or other data source.
For example, if a report is run with a request parameter of CustomerID, LocalData can get the FirstName and LastName. Under LocalData, add a DataLayer.SQL with the Source:
SELECT FirstName, LastName FROM Customers WHERE CustomerID='@Request.CustomerID~'
In the report you get the FirstName or LastName with @Local tokens, like:
@Local.FirstName~ or @Local.LastName~
Reports may have any number of LocalData elements.
When the LocalData element has an ID, that ID may be used to distinguish between values from multiple LocalData elements. Using the example above, if the LocalData element has ID="Customer", then the @Local tokens may include the ID, like:
@Local.Customer.FirstName~ or @Local.Customer.LastName~.
When ID attributes are not used, and there are multiple LocalData elements with DataLayers having the same column/attribute name, the values from the last LocalData are used. To reference earlier values, use LocalData IDs as described above.
LocalData uses only the DataLayer's first row.
@Local variables are good for the duration of a web request.
In some cases you may not want LocalData DataLayers to run all the time. Skipping them may help performance. Use a Condition attribute to conditionally run LocalData. |