Hi,
I am creating a report with 2 Tables. I need to assign Label for each row in the Tables. Instead of assigning/hardcoding the Labels in the Report.view.php, I want the Labels to be captured in DataStore as a column.
Table A:
P1 EOS
P2 UJE
P3 UBK
P4 KKD
Table B:
P5 IEJ
P6 LJW
P7 KJN
P8 YTD
I tried doing this way for Table A, but the counter only increment once.
$ctr= 0;
$this->src('packages')
->pipe(new Filter(array( ....)))
->pipe(new Sort(array( ....)))
->pipe(new Limit(array(4)))
->pipe(new CalculatedColumn(array(
"Counter"=>function($row) use($ctr)
{ return $ctr; }
"Label"=>"{Counter}+1",
)))
->pipe(new Custom(function($row){
$row["Label"]=>"P".$row["Label"];
...
Hope someone can share how this can be done correctly. Thank you