Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: New user questions  (Read 5363 times)

iwbnwif

  • Newbie
  • *
  • Posts: 7
    • View Profile
New user questions
« 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:

Code: [Select]
$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!



« Last Edit: August 31, 2016, 01:41:04 pm by iwbnwif »

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1005
    • View Profile
Re: New user questions
« Reply #1 on: September 05, 2016, 09:50:33 pm »
Hi

1. You can use in TextItem something like this
Code: [Select]
$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 .

iwbnwif

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: New user questions
« Reply #2 on: September 05, 2016, 10:51:09 pm »
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.


Subst

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
Re: New user questions
« Reply #3 on: September 06, 2016, 07:14:17 am »

iwbnwif

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: New user questions
« Reply #4 on: September 06, 2016, 12:08:33 pm »
@Subst thank you for the link, it is a good place to get started and I will try to find some tutorials also.

Subst

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
Re: New user questions
« Reply #5 on: September 06, 2016, 12:22:18 pm »
iwbnwif, some useful samples you can find in {QT_DIR}\qtscript\examples\script

iwbnwif

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: New user questions
« Reply #6 on: September 06, 2016, 05:32:03 pm »
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.

Subst

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
Re: New user questions
« Reply #7 on: September 07, 2016, 06:23:31 am »
Thanks to Alex Arin for the project   ;)

iwbnwif

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: New user questions
« Reply #8 on: September 07, 2016, 11:58:19 am »
Quote
Thanks to Alex Arin for the project   ;)

Yes, I totally agree.