Automating Export

(7 posts) (2 voices)

Tags:

No tags yet.

  1. haigda, Member

    Afternoon,

    This is probably very easy but I just can't get my head round it.

    I am working on a cash batching editable report that once the user has finished with needs to generate and printout a PDF without user intervention(I have wkhtmltopdf installed). I get the impression I need to do this by 'getting' the URL of the report output and adding '&export=pdf' to the end of it. Is there an easy way of getting the URL once concatenated, how would I get it to print?

    Cheers,
    David

  2. myDBR Team, Key Master

    Could you be more specific how the export would happen? What would trigger the output and what do you mean by "how would I get it to print"?

    --
    myDBR Team

  3. haigda, Member

    Thanks for the prompt reply.

    The final part of the sequence is that when the batch has been completed ('Tagged') the user presses a button that updates the underlying data, receive an on screen acknowledgement and then a report is generated to provide a hard copy / pdf copy of the batch (for example - http://byglenton.bitnamiapp.com/mydbr/report.php?r=13&p1=GLA0002&p2=2014-07-28%2011%3A44%3A20%20pm&p3=dba&m=1&h=e2536d6fb6d632e5710ba2084871e146b70ef8e5)

    What I'd like to do is have as little 'user intervention' as possible - even if they can use the 'Export to PDF' menu item. This really stems from the auditors wanting a physical record of the batch at the time of creation, and the less reliance on the user remembering to do so the better!

    I hope that's enough information, let me know if you need anything else.

    Cheers,
    David

  4. myDBR Team, Key Master

    David,
    you can have the final screen acknowledgement report to appear as PDF to the user. You can use JavaScript "window.print()" to initiate the print dialog for the user. Other options would be to send the pdf copy of the report as email to the user.

    --
    myDBR Team

  5. haigda, Member

    That is exactly what I'd like to do - but I'm still a bit confused as to how I get to that. Database / SQL I can do, but JavaScript is a 'black art' at the moment. Is there a sample I can look at?

    Cheers,
    David

  6. myDBR Team, Key Master

    You can put the window.print() JavaScript to normal HTML report simply by adding:

    select 'dbr.javascript', 'window.print()', 'onload';

    If you already are showing a PDF output to user, then user can simply use "Print" from the browser's menu. Unfortunately the embedded JavaScript will not initiate the print within PDF document.

    --
    myDBR Team

  7. haigda, Member

    Once again, thank you.

    Cheers,
    David


Reply

You must log in to post.