Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Hi Eugene,
Please try to add refNo and id to row dimension to see if it works for your requirement. Another option is to group date and refNo and id into one field:
select ..., concat(date, '-', refNo, '-', id) as dateRefID from ...
Then use dateRefID in the pivot's row dimension. Let us know your opinion. Thanks!
Hi Eugene,
In both PivotTable and PivotMatrix widgets you have a "map" property that is similar to Table's formatValue function:
PivotTable::create(array(
...
'map' => array(
'rowHeader' => function($rowHeader, $headerInfo) {
return $rowHeader;
},
'columnHeader' => function($colHeader, $headerInfo) {
return $colHeader;
},
'dataCell' => function($value, $cellInfo) {
return $value;
}
),
...
))
Just modify $rowHeader, $colHeader or $value to your link and return it. Thanks!
Thank you, David, but It looks like I need some examples. The docs are not enough for me and I cannot understand how to add the link to the value in only one column that I need
My Pivot process:
$this->src('quinos')
->query($query)
->params($query_params)
->saveTo($node);
$node->pipe($this->dataStore('p'));
$node->pipe(new Pivot(array(
"dimensions" => array(
"row" => "Partner, dateRefID"
),
"aggregates"=>array(
"sum" => "total",
"count" => "total"
)
)))
->pipe($this->dataStore('purchasing'));
I would like to add the link to the dateRefID value and the link must include the id but it is not the part of the row now...
Hi Eugene,
In your case, if you want to add link to dateRefID field please try this:
PivotTable::create(array(
...
'map' => array(
'rowHeader' => function($rowHeader, $headerInfo) {
if ($headerInfo['fieldName'] === 'dateRefID')
return "<a href='path/to/$rowHeader'>$rowHeader</a>";
else
return $rowHeader;
},
),
...
))
Let us know if this works for you. Thanks!
Thank you, David
But how to add the id to the link. If it were the usual table I could use the row array but I don't have the id field after the pivot process already but I still need it to use in the link... as a solution, I can try to get it from the sting dateRefID but is it the optimal way?
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo