When rendered using the default settings, a CSV report has the following characteristics: The first record contains headers for all the columns in the report. All rows have the same number of columns. The default field delimiter string is a comma (,). Formatting and layout are ignored.
Inheritance: extends Piwik\DataTable\Renderer
Esempio n. 1
0
 /**
  * @group Core
  */
 public function testRenderArray4()
 {
     $data = array('a' => 'b');
     $render = new Csv();
     $render->setTable($data);
     $render->convertToUnicode = false;
     $expected = 'b';
     $this->assertEquals($expected, $render->render());
 }
Esempio n. 2
0
 /**
  * @param DataTableInterface $table
  * @param string $uniqueId
  * @return \Piwik\DataTable\Renderer\Csv
  */
 protected function getRenderer(DataTableInterface $table, $uniqueId)
 {
     $csvRenderer = new CsvDataTableRenderer();
     $csvRenderer->setTable($table);
     $csvRenderer->setConvertToUnicode(false);
     $csvRenderer->setApiMethod($this->getApiMethodNameFromUniqueId($uniqueId));
     return $csvRenderer;
 }