How do I add a link to the CSV download created by the Forena module to my module page?

Do I just copy the link in 'inspect element' and put that in my $output variable that I return on the recommendations page?

up vote 3 down vote accepted

For any report that you create (using Forena), just add .csv as an extention to the report (output) URL. That contains the CSV equivalent of that report.

As a sample, consider the sample report located at /reports/sample.states (in your own site, one of the samples shipped with Forena). Change the URL to /reports/sample.states.csv (= just add .csv to it) to get the same report in .csv format.

If you'd adding such .csv to the URL of the Simple Table of States in the demo site, the result is like so ...

Same technique applies for other supported extensions (export formats), such as adding .html, .xls (MS Excell), .pdf or .doc (MS Word).

By the way, all data blocks are accessible directly via their url also, provided you have permission to access that block. Here are a few samples of that, for the sample report located at /reports/sample.states:

  • Hey, that's easy! Thanks @Pierre.Vriens – Sage Jul 15 '15 at 20:09

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.