KoolReport's Forum

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

Adding new column for date #384

Open mike opened this topic on on Jul 20, 2018 - 1 comments

mike commented on Jul 20, 2018

hi team,

->params(array(
		    ":start"=>$this->params["dateRange"][0],
            ":end"=>$this->params["dateRange"][1],
        ))
->pipe(new CalculatedColumn(array(
                        $date= $this->params["dateRange"][0];
		  "date"=>function($this->params["dateRange"][0]<=$this->params["dateRange"][1]){
                             return  date("Y-m-d", $date);
			  $date = strtotime("+1 day", strtotime($this->params["dateRange"][0]));  
		  }
		)))
->pipe($this->dataStore("data_type"));

its not able to print date in date column ..

I want to add Date column with asc order from start date range to end date range ......

KoolReport commented on Jul 22, 2018

Hi, the CalculatedColumn is a process to generate new column from existed column by formula or defined function.

The format of CalculatedColumn is:

-pipe(new CalculatedColumn(array(
    "columnByFormula"=>"column1*column2",
    "columnByFunction"=>function($row){
        return $row["column1"]*$row["column2"];
    }
)))

So back to your issue, could you please let us know the detail of what you want to complete. If possible, upload a picture of end result.

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