2 Columns of Data

Started by Paul M., July 27, 2017, 03:50:19 PM

Previous topic - Next topic

Paul M.

Hi,

Version 2.50 Genero

Printing 2 columns of data with 6 rows in each col.
In the attached file Col1 the yellow & green areas are my two columns. I am printing 6 rows in each, the yellow  area is fine but in the green area the date that is printed beside "Inspected By" is actually printed beside "Date" in my design and I am guessing that is because there is no data in the 3 rows printed before this.
So how do I pad out each row if there is no data(this time) so that "27/07/2017" lines up beside "Date".

Simple I am sure but it eludes me.
Thanks.

Col2.jpg is my layout



Alex G.

Hi Paul,

When a value in a WORDBOXWRAPBOX is the empty string it is does not occupy any vertical space to that in a vertical box things move up into the empty space.
To prevent this from happening you can either use a WORDBOX instead or change the RTL expression slightly from {{pr.reference.ref_is2}} to {{pr.reference.ref_is2.length()==0?" ":pr.reference.ref_is2}}.

I hope that this helps.

Kind regards,

Alex

Paul M.

Alex,

Wordbox sorted it. I dont need it to be a WordWrapBox.
Never knew that about the wordwrapbox not taking up space.
I knew it would be simple.

Thank you.

Reuben B.

With regard to Alex's answer, I think you should focus on the X-size, Y-size property of the WORDBOX and WORDWRAPBOX.  Ask yourself, if you don't explicitly define a X-size Y-size value, what is the value of this property. 

With regards to your form design, two alternative suggestions.

You have gone the approach of one HBox with two VBox as children.  I normally go the other way round, one Vbox with 6 Hbox as children.  Each HBox then contains the label and matching value.   Your question will then be, how do you get the columns to align.  Control-select the 6 label fields and in one go set their X-size property to a value e.g. 2cm, or width("longest label"), or max(width("field1"),width("field2")...)

I have also seen Table object been used in similar circumstances.  Delete the body element, clear the border/rule properties, leaving just a header with 2 column and 6 rows.

Reuben
Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero