Changes

Reporting (Plugin)

811 bytes added, Tuesday at 08:57
/* Custom Code */
* fullPdfFileName: The full path to where a PDF version of the report should be created at. This parameter is optional and can be null.
The resulting HTML code is returned by the method.
 
Since Version 5.2 it is possible to configure the maximum number of iterations allowed in a Scriban template loop.
If necessary, the loop limit can be set to a value higher than 1000. If not configured, the default value of 1000 will be used.
 
The method RenderReport is marked as obsolete.
We recommend to use RenderReport(string templatePath, ...) instead, providing the full path including file extension.
 
 
<syntaxhighlight lang="csharp">
UBIK.Module.Reporting.ReportEngine reportEngine = new UBIK.Module.Reporting.ReportEngine(2000); // set the loop limit to 2000
string htmlContent = reportEngine.RenderReport(templatePath, reportObject, fullPdfFileName);
</syntaxhighlight>
 
[[Category:Coding|Reporting (Plugin)]]
[[Category:Installing|Reporting (Plugin)]]
[[Category:Plugin|Reporting (Plugin)]]
 
=== Template ===
[https://github.com/scriban/scriban Scriban] is a scripting engine that can be used to parse text templates. In our case, this means we can create an HTML file and put placeholders into parts of the file where we want report data to show up. We also can use the scripting features to create many rows of a table in a loop, for example. In the Scriban code, the default object is called "report_object". If this report_object has properties, you can access them by writing report_object.property_name (fill in the actual name starting with a lower case and with underscores separating the words). For more detailed information about Scriban, please refer to the "see also" section.
1,698
edits