Date format in pdf

(15 posts) (2 voices)

Tags:

No tags yet.

  1. ziuras, Member

    Hi,
    I instaled new machine (debian 9, php7.0, ms sql driver) with mydbr 5.1.0
    and have some problems:

    1. in report view the date format is 2018-07-12, but in exported pdf in header i see [logo] 12 Jul 2018 09:04:09 ..... 1/1
    how to pass to wkhtmltopdf to use isodate format?

    2. in old instalation, i had changed order of lines colors of graph. and i can not find this place now.

  2. ziuras, Member

    2. about line colors, found it in /defaults.php
    but the old instalation was owerwriten when i upgraded mydbr from 4.9.x to 5.1.0
    can we store color lines order in /user/ where our changes will stay afted upgrades.

    sorry for my english :)

  3. myDBR Team, Key Master

    You should make all the defaults / CSS changes to /user/defaults.php and /user/userstyle.css as the versions in the main level are part of myDBR distribution and will be overwritten in each update. myDBR update will not touch the files in /user.

    --
    myDBR Team

  4. ziuras, Member

    thanks, and what about date format in pdf header?

  5. ziuras, Member

    can you write example howto write in /user/defaults.php colors array?

    $mydbr_defaults['chart']['colors'] => [0xf43011, 0x000000, ....]

  6. myDBR Team, Key Master

    Have you overwitten the wkhtmltopdf header with your own? myDBR uses by default the ISO 8601 user's date format in PDF headers.

    You can take a look what the PDF export command is if you use the debug-option:

    select 'dbr.export.options', 'debug', 1;

    You should see entry like --replace rdate "2018-07-12" passed in.

    --
    myDBR Team

  7. ziuras, Member

    $ /usr/local/bin/wkhtmltopdf -q --margin-top "20" --header-spacing "8" --header-html "https://report.kmv.local/user/export_header_pdf.php" --replace rdate "2018.07.12" --replace rtime "10.40.28" /tmp/mydbr_export_700984880.html debug_output.pdf

  8. myDBR Team, Key Master

    Ah, sorry for the last post. myDBR actually uses the user's date format choises in PDF exports (defined in user's Preferences -> Settings -> Date).

    The formatted date is passed to wkhtmltopdf with the replace option (rdate-parameter) and then is placed in the header in export_header_pdf.php.

    --
    myDBR Team

  9. ziuras, Member

    my environments settings:
    Date: 2018-12-30
    Time: 22:00:12

  10. myDBR Team, Key Master

    The format in "replace rdate" should match the format in your preferences.

    Have you modified the export_header_pdf.php file?

    If not, you can make sure the version is the correct one by going to Admin Tools - > Server side files and clicking the Server side files and clicking the "export_header_pdf.php" under the myDBR.com (the last line from left). This will fetch the export_header_pdf.php-file from myDBR.com and you can then save the file as your own by clicking the save-icon.

    --
    myDBR Team

  11. ziuras, Member

    no i did not modified export_header_pdf.php (size 2569)

  12. ziuras, Member

    i found that in parameters (date picker) i see 2018.06.12
    in mydbr->environment settings->date 2018-12-30
    in report cloumn output i see 2018-06-12

  13. myDBR Team, Key Master

    That should do it. What is the output if you use the debug-option and run the wkhtmltopdf-command manually. The replacement is done in export_header_pdf.php's JavaScript (function subst()).

    If you still have a problem, please open a support ticket in email so we can contact you to see what is causing that in your setup.

    can you write example howto write in /user/defaults.php colors array?

    $mydbr_defaults['chart']['colors'] => [0xf43011, 0x000000, ....]

    You can override the individual $mydbr_defaults array elements in /user/defaults.php:

    $mydbr_defaults['chart']['colors'] = [0xf43011, 0x000000, ....];

    --
    myDBR Team

  14. ziuras, Member

    ok now in pdf header i see 2018.07.12 11.43.34
    and in pdf body 2018-06-14

    its ok.

    thank you

  15. myDBR Team, Key Master

    Both dates (PDF header and actual PDF content) should use the user's date choise unless you format dates specifically by converting them into strings in the report (which you should not do as keeping the dates as dates will give you correct sorting etc).

    --
    myDBR Team


Reply

You must log in to post.