Using Velocity in Servoy
Posted: Mon May 24, 2021 7:01 am
Is there anything, anywhere that will detail how to access the XHTML template for a Velocity report in Servoy? I have read through the documentation, I have looked through the many layers and objects of the Velocity sample projects and I just want to see how I transfer a merge a foundset with a template to produce a report.
It looks like the renderTemplate() is the one, which simply refers to the evaluateWithContext(), which states:
Is any kind of Servoy object a foundset/dataset/datasource? How does it differentiate and thence how do I refer to the data within those differing (internally described) Servoy objects?
Any help would be appreciated...
It looks like the renderTemplate() is the one, which simply refers to the evaluateWithContext(), which states:
This method will allow you to use the power of Velocity to build some text or html using a String template and a Context object.
The signature is:
String evaluateWithContext(String templateContent, JSObject contextObject, [REPORT.resolution])
Basically, you pass it a String, containing placeholders ($variable) and then pass it a JSObject (new Object() or {}) filled with any kind of Servoy object to replace the placeholders.
Is any kind of Servoy object a foundset/dataset/datasource? How does it differentiate and thence how do I refer to the data within those differing (internally described) Servoy objects?
Any help would be appreciated...