Categories > TinyButStrong general >

Conditional field display

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Michael
Date: 2011-07-13
Time: 13:20

Conditional field display

Maybe something stupid - but I can't find a solution:
Inside a block I want to avoid repeating similar values. I tried it with parentgrp without success.

The template looks like this
[block1;block=begin]
...
<tr><td>[block1.value1;block=tr]</td><td>[block1.value2]</td></tr>
...
[block1.block=end]

the Result is for example

12 | 13.5
12 | 17.6
12 | 23.0
14 | 24.5

but my Result should look like
12 | 13.5
(empty) | 17.6
(empty) | 23.0
14 | 24.5

Any suggestions?
By: TomH
Date: 2011-07-16
Time: 15:32

Re: Conditional field display

I see no parentgrp specified in your code...

please include the complete actual code (not psuedo-code as above) that was not working so we might be able to help you

cheers,
TomH
By: Michael
Date: 2011-07-20
Time: 09:17

Re: Conditional field display

Hi to everyone and sorry for delay

Yes you're right, the obove mentioned code snippet is only the description of how the result actually is (row-by-row without compressing repeating values).
So my question is, howto extend this example to get my desired result.

On php side: simple array with values P2 for Version and F4 for SN.

My first approach using "headergrp":
<h3>Listing</h3>
<table>
<tr><td>Version:</td><td>[block1.P2;headergrp=P2;block=tr]</td><td>SN:</td><td>[block1.F4]</td></tr>
<tr><td></td><td></td><td>SN:</td><td>[block1.F4;block=tr]</td></tr>
</table>

This is nearly what i am looking for, but the values of headerline is repeated in the following tr (and i know that this should be). How to avoid?

Result:
Version: 12 SN: 2525  -- headerline
(empty) SN: 2525  -- this line is repeated although there is only 1 data
Version: 13 SN:    4517  -- headerline
(empty) SN: 4517  -- this line is repeated
(empty) SN: 6218  -- this is the second dataset (correct)
Version: 14 SN: 3421
(empty) SN: 3421  -- first dataset
(empty) SN: 9845  -- second dataset
(empty) SN: 5174  -- third dataset

Then I replaced the "headergrp" with "parentgrp" with the same result.
Maybe "grouping" this is a wrong way, but i am not a skilled programmer and find no suitable solution.

I am working with Report Designers on Databases where I have the standard option "Delete repeating values". This option I would like to use for my simple html table.

Thanks,
Michael