LimeReport Forum

General Category | Основное => Discussion | Обсуждение => Topic started by: Paul Traut on September 25, 2017, 02:48:14 PM

Title: List of all variables
Post by: Paul Traut on September 25, 2017, 02:48:14 PM
Hi,

is there a possibility to get all report variables from a template?
And it would be best, if I could mark some variables as mandatory within the template, so that no report can be created as long this variables are not set.

Why do I need this?
My idea is to generate a dynamic GUI, which gives me fields for all variables within one template so that the user can type in the data. Therefor it would also be great when the variable would store a type information (QString, Int, Date,...)
Also I would like to check if this variable is mandatory for the report and only generate the report when all mandatory variables are set.

Hope you can understand what I mean  :)
Title: Re: List of all variables
Post by: Arin Alex on September 26, 2017, 12:56:08 AM
Hi!
I have added ability to set data type and mandatory to the report's variables (develop branch at github).
Also i have extend IDataSourceManager interface.
From now you can get all information about the report's variables:
1. Variable names via report.datamanager.variableNames()   
2. Variable data type via report.datamanager.variableDataType(const QString& name)
(enum VariableDataType {Undefined, String, Bool, Int, Real, Date, Time, DateTime})
3. Variable mandatory via report.datamanager.variableIsMandatory(const QString& name)
4. via report.datamanager.variableIsSystem(const QString& name) you can check that the variable is system
Title: Re: List of all variables
Post by: Paul Traut on September 29, 2017, 09:13:52 AM
Thanks :D