Element Details: Local+Data
 Back


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.



ATTRIBUTES

Click attribute Name to drill down for more information.

NamePossible ValuesDescription
Condition
UserDefined
An expression that evaluates to a value of True or False. Expressions should be in JavaScript (recommended) or VBScript syntax. For .NET versions, the scripting language can be set in the _settings.lgx General element. For Java versions, the scripting language is always JavaScript. Typically, you would compare values using a token, such as "@Data.value~ < 0" or "@Session.ShowCol1~=='true'". Elements are removed when the Condition evaluates to False. Use quotes when working with strings: "@Data.myColumn~" == "SomeValue" If your data token may have a double quote inside of it, you should use single quotes: '@Data.myColumn~' == 'SomeValue' String valued data tokens with single and double quotes inside are not supported by the condition attribute.
ID
UserDefined
The ID attribute is a pervasive attribute that uniquely identifies an element within a definition file. The ID needs to be a unique value within the definition.



PARENT ELEMENTS

Click element to drill down for more information.

Data
Etl Job
Loop.Data Layer Rows
Mobile Report
Panel
Process
Report
Template
Widget


CHILD ELEMENTS

Click element to drill down for more information.

DataLayer.Bookmarks
DataLayer.Cached
DataLayer.CSV
DataLayer.Definition List
DataLayer.Directory
DataLayer.Excel
DataLayer.Google App
DataLayer.Google Spreadsheet
DataLayer.JSON
DataLayer.LDAP
DataLayer.Linked
DataLayer.Mongo Find
DataLayer.Mongo Map Reduce
DataLayer.Mongo Run Command
DataLayer.Plugin
DataLayer.REST
DataLayer.Scheduler
DataLayer.SP
DataLayer.SQL
DataLayer.Static
DataLayer.Twitter
DataLayer.Web Feed
DataLayer.Web Scraper
DataLayer.Web Service
DataLayer.XML


 Back to top


 Chart Debug