Customizing the CSV export

(6 posts) (2 voices)

Tags:

No tags yet.

  1. apao, Member

    Hello everyone,

    I have a heavy report (more than 30,000 rows, more than 40 columns), which MyDBR does not manage to handle in Excel format (although I raised the allocated RAM of PHP to 1Go and raised the timeout to 20 minutes).
    That is why I have switched to a CSV export, but unfortunately, in that case, users have to convert data once the Excel has opened the file because Excel does not natively "understand" it. To avoid this and enable Excel to display it correctly without any user intervention, I would need :
    - the CSV file to use semicolons ";" instead of commas "," as a delimiter
    - the CSV file to use commas "," instead of dots "." as a decimal separator

    Is there a way to adjust this in myDBR?

  2. myDBR Team, Key Master

    See export options from the documentation:

    http://mydbr.com/doc/?cmd.export.html

    select 'dbr.export.options', 'csv.delimiter', ';'
    select 'dbr.export.options', 'csv.decimal_point', '.'

    --
    myDBR Team

  3. apao, Member

    Many thanks!
    Is there any configuration file where I could write this so that I do not have to specify it in every report?

  4. myDBR Team, Key Master

    Sure,
    just override the $mydbr_defaults['export']['csv'] array elements in mydbr/user/defaults.php.

    --
    myDBR Team

  5. apao, Member

    Great! Thanks!
    My report still needs 2'30" to be produced in CSV. Since the SQL query itself takes only a few seconds, do you see any optimization I could make in myDBR settings to produce it faster?

  6. myDBR Team, Key Master

    Having a query that has 30K rows with 40 columns will take some time to go through the result set and convert to CSV (the result size should be something like +10Mb). The CSV conversion itself is very straightforward.

    --
    myDBR Team


Reply

You must log in to post.