Exporting custom SQL report to PDF

Exporting custom SQL report to PDF

by Sumanta Ghosh -
Number of replies: 4

Hi ,

I just completed a simple course completion report in Tim Hunt's Custom SQL plugin and submitted here

http://docs.moodle.org/26/en/ad-hoc_contributed_reports#Course_Completion_Report_with_custom_dates

Just wondering if it's possible to give the user the option to download the generated report in excel or pdf. By default CSV is there. Is there a way to forward the data to a page and convert it to these file format when the user click the link at the end of the page. Just a thought.

Thanks,

Sumanta

Average of ratings: -
In reply to Sumanta Ghosh

Re: Exporting custom SQL report to PDF

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Why PDF? HTML would be much simpler. In your web browser. Just do Save as...  on the page.

In reply to Tim Hunt

Re: Exporting custom SQL report to PDF

by Sumanta Ghosh -

Hi Tim,

I know. But wish I could convince people at my end so easily, as they love things as they are. They are using a commercial system (not moodle) which gives PDF download option and makes it easier for them to mail. So it's like asking them to compromise and I will be flooded with reasons depicting "why not".

sad

 

-Sumanta

In reply to Sumanta Ghosh

Re: Exporting custom SQL report to PDF

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hang on, if they want to send an email, well, just copy the report table into the email.

Or, have you spotted the features where the system can automatically run the query every day/month/week and email it to someone?

You could install a PDF print-driver, then generate the PDF using your web browser's print feature.

Or, you could write the code to export as PDF. Moodle has a library for generating PDF (see the certificate module for an example of how to use it: https://moodle.org/plugins/view.php?plugin=mod_certificate )

In reply to Tim Hunt

Re: Exporting custom SQL report to PDF

by Sumanta Ghosh -

That's a good lead. Thanks, Tim.

I will try to explore more on certificate and simple certificate module