Categories > OpenTBS with ODT >

How to get number of rows of a sub block having conditions

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Nguyen
Date: 2016-03-09
Time: 10:27

How to get number of rows of a sub block having conditions

Hello,
In template, i have a block like this
[PEC; block = begin; sub1=INVITES;]
[PEC_sub1.PS_NOM; block=tbs:row; when [PEC_sub1.PS_TYPE] = [FIELDS.TYPE_PS]]

The result is:
NOM
___________
BINENO MUHEMM

MOHAMMED BENANI

The question is: How can I get number of rows of PEC_sub1.block with the condition "when [PEC_sub1.PS_TYPE] = [FIELDS.TYPE_PS]"?


Thank you in advance

NTT
By: Skrol29
Date: 2016-03-11
Time: 21:38

Re: How to get number of rows of a sub block having conditions

Hi,

The number of the row in the data source can be given by [PEC_sub1.#].
But the number of the display row in the template cannot be done directly by TBS since you can have several conditional sections displaying the same row.

The solution is to calculate such a row number at the PHP side using a custom function for parameter "ondata".
By: Nguyen
Date: 2016-03-15
Time: 11:00

Re: How to get number of rows of a sub block having conditions

Thank Skrol29