[Working with scripts]: Working with Data Caches

A DataCache object represents a set of records and an index identifying the current record. By default, these records are loaded by the “DataCacheManager” and provided on demand. However, it is possible to use the functions of DataCache to alter the records and store the modified cache into the “DataCacheManager” for subsequent components to use.

The filter(fieldname, value) method returns a new DataCache which contains a subset of the original cache, retaining only those records where fieldname contains value.

See “DataCacheManager” for an example.

DataCacheManager

The “DataCacheManager” provides cached access to datasources, so that the records are not read more often than necessary. You can obtain a DataCache using the getCache(name) method. You can also set a cache explicitly using putCache(name,cache). This option to prime the cache manager by inserting records allows arbitrary record processing at any stage in the report generation process.

Example :

=Code Snippet=
var all = DataCacheManager.getCache("All");
var filtered = all.filter("Column",Value); // substitute appropriate column names and values
DataCacheManager.putCache("Filtered",filtered);

Sample :

  1. Save DataCache.jar to desired directory
  2. Run Elixir Report Designer
  3. Click on ‘Add FileSystem’ and select ‘Jar FileSystem’
  4. Enter ‘KnowledgeBase’ for Name and locate ‘DataCache.jar’

Please rename the following attachment from .txt to .jar
DataCache.txt