I've installed Forena Reports. It's basically working, but I have some questions (see bottom of post to get right to it).
What I want to accomplish is the following:
I want an anonymous user of the module page to be able to export their recommendations as a CSV file with a link like 'download now' or something.
Here's the staging environment for the tool I'm talking about, so you can see how it works: http://staging.grantstation-pathfinder.com/pathfinder
So, as you can see, here's what I have so far:
I have a custom module that's a multi-step form. The module prints out each page of the form. The user selects one option on each page (3 pages total) and on the final page submits the form. The module then redirects the user to a 'recommendations' page (page 4 - modulename/recommendations) where some custom SQL prints out to the page recommended resources for that user based on their selections in the form.
The values the users selected are saved in session vars.
On the recommendations page I call SQL and use the session variables to determine which recommendations to display to users.
I successfully installed and configured forena reports and it displays my tabular data from the SQL file I created with the parameters I set manually. The CSV download works too. That's all fine.
My questions now are the following:
Most importantly! how do I ensure forena uses the session variables set by the user in the multi-page form (and not my predefined parameters)?
How do I add a link to the CSV download to my module page?
Maybe I just copy the link in 'inspect element' and put that in my $output variable that I return on the recommendations page?
- How can I choose how to display the fields from the database returned by the data block? (ie. one field just returns a number, but each number for that field represents something else that I'd like to display...ie: if (id=5) { $text = "see website"; } else { $text = "free"; } Or, if this is not possible, how in general can I edit how the fields are displayed?
Maybe #3 is something I just need to read more about. If it's just that, let me know and I'll look into it more in the Forena docs.