LimeReport Forum
General Category | Основное => Discussion | Обсуждение => Topic started by: darktorres on June 06, 2016, 06:35:24 am
-
Hi, is there some way to only print text from datasource if it´s not empty?
-
Hi, What do you mean only print text ?
-
In the databand is there some way to show a secondary value if it´s not null? Like: $D{db.price} + if(!$D{db.discount}.empty) $D{db.discount}
-
$S{if ($D{db.price}!="") $D{db.price} + " "+$D{db.discount}; else ""}
-
Thanks!
-
Similary to this: empty fields, or not existing field in the actual query: how can we suppress the warnings ?
We have reports used by many customers, and sometimes some fields does not exists for one.
In this case we want to suppress the warning message but did not find any solution ?
Opened: https://github.com/fralx/LimeReport/issues/38
-
try to use external variables from your program. That determine need or needless printing
-
I have added "Suppress absent fields and variables warning" parameter to report settings
-
Thanks!
Now the next issue :)
We can now quiet warnings for missing fields, but I did not find a way to give fallback values.
When a field is missing, it seems the custom script exit instead of simply return null value for the queried field:
$S{
"$D{Marcel.pagnol}" === "" ? "$V{Marcel.pagnol}" : "$D{Marcel.pagnol}"
}
The data source Marcel and the field pagnol does not exists, though I have declared a custom variable Marcel.pagnol.
What I want is to fallback to my custom variable if the data source field does not exists.
Actually this throw: SyntaxError: Parse error
Any ideas ?
EDIT: In the end it does just works! I was missing the quotes around the variables.