How To Use Data Cache

This recipe demonstrates how to use data cache in the report template.

Major steps include the following:

  1. Create a report template using the given datasources:
  2. FruitSales.ds
  3. FruitSales.ds
  4. cmps-FruitSales.dsAdd the parameter below into the “Parameters” page:Name=Company, Value=${Company}, Enabled=True.
  5. Add the following Data Fields (Literal) under “Section Header”:
  6. From Cache
  7. From Cache2
  8. From Cache3 (ds with parameter)
  9. From DataField: Fruit
  10. Add the following Data Fields (Script) under “Detail”:
  11. //total_record;
    cache.getObject(total_record, “Fruit”);
  12. //total_record;
    cache2.getObject(total_record, “Fruit”);
  13. /total_record;
    cache3.getString(“Fruit”);
  14. Select the “Fruit” field in the Data Field (Field).

Screenshot when the user enters “A” for the Company parameter:

HowToUseDataCache

To download the necessary files for this recipe, refer to the attached ZIP package.
HowToUseDataCache.zip (4.6 KB)