KoolReport's Forum

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

No Data with CSVDataSource #506

Open LCR opened this topic on on Oct 31, 2018 - 3 comments

LCR commented on Oct 31, 2018

Hi,

I have csv file with 2 columns (Customer_id_customer, Contract_month_cost=number) I 've checked this csv file exists. In the view I have no data;

Below my class Report Do you have an idea ?

Thanks & regars

function settings()
{
	

	return array(
		"dataSources"=>array(
			'mysource'=>array(
				'class'=>'\koolreport\datasources\CSVDataSource',
				'filePath'=> 'xxxxxx.csv',
			)
		)
	);
	
}
function setup()
{
	
	$this->src("mysource")
	 ->pipe(new ColumnMeta(array(
		  "Contract_month_cost"=>array(
			"type" => "number",
		  ),
		)))
	 ->pipe(new Pivot(array(
	  "dimensions"=>array("column" => null,"row" => "Customer_id_customer",
	  ),
	  "aggregates"=>array(
		"sum" => "Contract_month_cost"
	  )
	)))
	->pipe($this->dataStore("mysource"));  

}
LCR commented on Oct 31, 2018

the column separator was missing !!

KoolReport commented on Oct 31, 2018

So have you been able to add the "fieldSeparator" property to the settings?

LCR commented on Oct 31, 2018

yes thank you

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
solved

Pivot