0

Final semester in my 2 year degree and I'm working on a volunteer project for a local non-profit. I have all the information (front-end and back-end) completed for the queries themselves and I'm trying to understand how I can generate a report for them that's mostly text-based so they can give volunteer hours in an easily-readable format for the courts to prove a volunteer did in fact volunteer.

I have a table and display already set up with the report but they would like a more professional "print out."

How would I go about doing this?

EDIT: Is there a way I can download the result set to an MS Excel/Word version for example?

EDIT2: Updated topic name to be more accurate based on whrrgarbl's comment. Previous topic name, "How to export to a file a MySQL result set?"

Green Ki
  • 1
  • 2
  • I'm unclear on what you want as there is a lot of extraneous information in your question. Any of these help? http://stackoverflow.com/questions/16391528/query-mysql-and-export-data-as-csv-in-php, http://stackoverflow.com/questions/8556704/using-php-to-export-a-mysql-query-to-a-downloadable-csv-file, http://stackoverflow.com/questions/125113/php-code-to-convert-a-mysql-query-to-csv ? – user812786 Mar 22 '16 at 14:32
  • Apologize. I'm new here and was trying to give as much background information as I could. Maybe I shouldn't. That first link would help me. Thanks. Feel free to reply to answer. :) – Green Ki Mar 22 '16 at 14:32
  • Can you just output a CSV file? If it has to be Excel then I guess you'd look for a PHP library which can write Excel files. – David Mar 22 '16 at 14:34
  • Background info isn't necessarily bad as long as it is pertinent to the programming issue, it just wasn't clear what the end goal was (export PHP to file? export MySQL query to file? generate a separate print format for a PHP page? etc). Your edit did help clarify though! – user812786 Mar 22 '16 at 14:37
  • My advise would be to have the display tables in data table format that way users can export in the format they want have a look at http://datatables.net – chapskev Mar 22 '16 at 14:39
  • @whrrgarbl that's what I want! "A separate print format." How would I do that with the current information/data I already have? – Green Ki Mar 22 '16 at 14:45
  • Hm..that's different from exporting. I think there's a number of ways. You could try a print stylesheet for instance, or something like add a GET variable to your URL (e.g. example.com/report?print). – user812786 Mar 22 '16 at 14:55

1 Answers1

0

You could use something like PDF Crowd to print a HTML page to PDF or you could look at using mPDF

Community
  • 1
  • 1
Zoe Epix
  • 63
  • 1
  • 10