columnsData is json, where you set the definition of this columns
Code:
{
"field1Name": {
"link":true,
"width":null,
"notSortable":false,
"align":"left"
},
"field2Name": {
...
}
}
{
"field1Name": {
"link":true,
"width":null,
"notSortable":false,
"align":"left"
},
"field2Name": {
...
}
}
1 <?php
2
3 namespace Espo\Custom\Reports;
4
5 use \Espo\ORM\Entity;
6 use \Espo\Core\Exceptions\Error;
7 use \Espo\Core\Exceptions\NotFound;
8
9 class test extends \Espo\Modules\Advanced\Reports\Base
10 {
11 public function run($where = null, array $params = null)
12 {
13 $jobs = $this->getEntityManager()->getRepository('Jobpse')->where(array(
14 'name' => '18-0089'
15 ))->find(['select' => ['id', 'name','deleted']]);
16
17 return array(
18 'collection' => $jobs,
19 'total' => $jobs->count(),
20 'columns' => ['name', 'id'],
21 'columnsData' => json_decode(json_encode([
22 'name' => ['link' => true, 'width' => null, 'notSortable' => false, 'align' => 'left'],
23 'id' => ['link' => true, 'width' => null, 'notSortable' => false, 'align' => 'left']
24 ]))
25 );
26 }
27 }
class test extends \Espo\Modules\Advanced\Reports\Base
... PHP Fatal error: Class 'Espo\\Custom\\Reports\\Base' not found ...
1 <?php
2
3 namespace Espo\Custom\Reports;
4
5 use \Espo\ORM\Entity;
6 use \Espo\Core\Exceptions\Error;
7 use \Espo\Core\Exceptions\NotFound;
8
9 class test extends Base
10 {
11 public function run($where = null, array $params = null)
12 {
13 return array(
14 'type' => 'Grid',
15 'groupBy' => array(),
16 'columns' => array('name'),
17 'sums' => array(),
18 'groupNameMap' => array(),
19 'columnNameMap' => array('name' => 'name'),
20 'depth' => 2,
21 'grouping' => array(),
22 'reportData' => array(),
23 'entityType' => 'Jobpse',
24 );
25 }
26 }
1 <?php
2
3 namespace Espo\Custom\Reports;
4
5 use \Espo\ORM\Entity;
6 use \Espo\Core\Exceptions\Error;
7 use \Espo\Core\Exceptions\NotFound;
8
9 class test extends Base
10 {
11 public function run($where = null, array $params = null)
12 {
13 return array('list' => [], 'total' => 0, 'columns' => ['name']);
14 }
15 }
custom/Espo/Custom/Modules/Advanced/Reports/test.php
[2018-07-22 15:52:21] Espo.ERROR: Uncaught Exception Error: "Class '\Espo\Modules\Advanced\Reports\test.php' not found" ...
Leave a comment: