LimeReport Forum
General Category | Основное => Discussion | Обсуждение => Topic started by: iwbnwif on August 31, 2016, 01:22:12 pm
-
Hi, I have been trying out some reports and have collected a few areas that I haven't been able to find an answer to.
1. Is it possible to set a parameter or script such that a TextItem doesn't take any space in the report if it is empty. A bit like the printIfEmpty feature for bands, but on individual database fields.
So for example if an address is setup like this:
addressline1
addressline2
state
zip
and the field "addressline2" is empty for a given record, then the output would be like this:
1600 Amphitheatre Parkway
California <- no vertical space from the top line
94043
instead of this:
1600 Amphitheatre Parkway
<- space reserved for addressline2
California
94043
I tried a script like this:
$S{if(address.addressline2 == "") THIS.geometry.height=0}
but it gives a parser error. Actually, a "printIfEmpty" checkbox for textItems would be even better if that is possible :)
2. Is it possible to set a space between a band and the next band if the "autoHeight" property is enabled? From what I found, an autoHeight band will always fit tightly to the bottom of the last object.
Similarly if I set the border for a band, it would be nice to have an adjustable gap between it and the border for the next band.
3. In the preview window, the zoom figure does not appear to relate to the actual zoom. For example, if I make it 100% zoom the paper size is much bigger than A4 on the screen. Is that because of my windows setup (Windows 10, dual monitor)?
4. How do I use the "format" property in the property inspector?
Sorry for the basic questions, but other than these things I was able to reproduce some quite complicated reports in a couple of hours, including learning LimeReport from scratch. The same reports took me days to setup in another tool, so big, big thanks!
-
Hi
1. You can use in TextItem something like this
$S{
function IFNN(str){
if (!str || str.length === 0)
return ""
else
return "\n"+str
}
$D{table.column1} + IFNN($D{table.column2})+IFNN($D{table.column3})
}
2. Use band property "keepBottomSpace"
4. To use "format" property you should select value type by "valueType" property then you can use
something like this "dd.MM.yyy" for date and "%.2f" for double in "format" property .
-
Thank you, that is really great - everything you suggested exactly answers my problems.
I can do everything that I need to do, LimeReport really is the best tool.
Obviously I need to spend more time to learn the scripting language better, but everything else is clear.
-
You can find specification here http://www.ecma-international.org/publications/standards/Ecma-262.htm
-
@Subst thank you for the link, it is a good place to get started and I will try to find some tutorials also.
-
iwbnwif, some useful samples you can find in {QT_DIR}\qtscript\examples\script
-
Ah, thank you it is always much easier when there are some examples to follow ;).
I have to say that this is a seriously impressive project.
-
Thanks to Alex Arin for the project ;)
-
Thanks to Alex Arin for the project ;)
Yes, I totally agree.