Hidden columns are displayed in the cvs export

Issue #28 invalid
Former user created an issue

classes/CsvTable.php

function start() {

$arr = array();

foreach ($this->_cols as $col) {
  • if (isset($col['hidden']) and $col['hidden']) {

  • continue;

  • }

    if (!isset($col['title']) or !$col['title']) {

    $col['title'] = $col['name'];
    

    }

function row($row) {

$arr = array();

foreach ($this->_cols as $col) {
  • if (isset($col['hidden'])) {

  • continue;

  • }

    $arr[] = $this->escape($row[$col['name']]);

    }

    echo implode(',', $arr)."\r\n";

}

Comments (3)

  1. Micah Stetson repo owner
    • changed status to open

    I'm not sure about this one. The reason to get CSV results is so you can do something with them in an external program. Many of the uses I can think of for this would need the primary key data (bibid, copyid, etc.), and that's what's usually hidden. Are these fields causing you problems in the export, or is it just confusing that you see stuff that isn't shown in the regular display.

    I can understand that argument, but I'm not sure simply hiding the data is the way to go. For example, I think you should be able to reconstruct the report display from the data you get via CSV. If you don't get the bibids, say, you couldn't make your book titles link to the books' pages.

  2. Former user Account Deleted

    First of all thank you for your fast response. OK. I understand the problem. I want to use the CSV export instead of generating PDF-Documents because the PDF-Document is not so clearly arranged at present. Furthermore I changed the report a little bit by adding some columns which is also difficult to display them all in the PDF-Document. So I want to import the CSV-File into EXCEL to arrange the columns there. But you 're right that someone may need that feature to import data into another program where those fields are necessary. So I think I have to delete them in the EXCEL-document.

  3. Log in to comment