KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to insert blank row in table after altering every data (column , row....) #392

Open mike opened this topic on on Jul 25, 2018 - 3 comments

mike commented on Jul 25, 2018

Hi ,

I have sorted table and I want to add empty row in very first row of table.. please suggest me how to do this ....

KoolReport commented on Jul 25, 2018

Please try to do this;

$data = $this->dataStore("mystore")->data();
array_unshift($data, array(
    "date"=>null,
    "free_ticket"=>null,
    ...
));

the you can display in the table:

Table::create(array(
    "dataSource"=>$data,
))
mike commented on Jul 27, 2018

Thanks.... but here I cant insert the value in column because this column is not static .... $TotalSold_byName->pipe(new RemoveColumn(array(

        "p_date",
        "ticket_qty" ,
        "Ticket_Id" ,
        "Ticket_name_e" ,
		"ticket_name",
		"e_attende_date",
        "p_sold_date",
		"ticket_id",
        "tixsold",
		"totaltix",
    )))
	->pipe(new Cube(array(
        "row"=>"Date_form",
        "column"=>"NameOnTickets",
        "sum"=>"Total_Tickets_Sold"
    )))
	->pipe(new ColumnMeta(array(
  "{{all}}"=>array(
  "label"=>"Total Tickets Sold",
   
))))
	->pipe($this->dataStore('together'));

Before datastore need to add null values for very generated column ......

David Winterburn commented on Jul 30, 2018

Hi Mike,

Please download the latest version of KoolReport and apply the following process to add an empty row to the start of your data flow:

use \koolreport\processes\Map;
...
->pipe(new Map([
            '{value}' => function($row, $meta, $index) {
                if ($index === 0) {
                    $emptyRow = $row;
                    foreach ($emptyRow as $k => $v)
                        $empty$row[$k] = null;
                    return [$emptyRow, $row];
                }
                else
                    return $row;
            },
        ]))
...

Let us know if this solves your problem. Thanks!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None