Needs work
Project:
Webform Report
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 May 2011 at 18:21 UTC
Updated:
21 Apr 2016 at 20:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
star-szrUnintended "feature": You can add hidden columns to the report to exclude them from the "all columns" CSV export. Works for me :)
Comment #2
star-szrSmall patch on top of original to at least document this.
Comment #3
star-szrSorry for the mess, I forgot to exclude markup fields. One more patch.
Comment #4
vako commentedI see that it will be an option, so people can choose to print or not the hidden columns. Thanks for the idea and the patch. Hope it will be tested and committed.
Comment #5
star-szrThanks Vako. Changing the title to more accurately describe this feature. Not sure if it makes sense to incorporate in the module but I thought I'd share anyway.
Comment #6
star-szrCombining the three patches into one, got rid of trailing whitespace as well. If you are using this in combination with hidden fields, you will need the patch from http://drupal.org/node/1175514#comment-4544734 to get everything lining up nicely in your CSV exports.
Comment #7
star-szrRegarding #3 - maybe we don't want to exclude markup fields after all. I forgot that you can use tokens and PHP code to customize these, so it might be useful to be able to export these as well.
Comment #8
jimbullington commentedThank you for the suggestion and the patch. I was wondering if you would consider putting this option on the CSV Export Options form instead of the Report Criteria form since the option is only valid for a CSV export. Putting it there would probably simplify the change as well...
Comment #9
star-szrThanks for the feedback, I agree. This probably isn't an option that many will use, so it makes sense to be tucked away. In my case I will just do a hook_form_alter to check that box by default.
The attached patch moves the checkbox to the report criteria form, and improves the wording slightly. I kept in the exclusion of markup components because it looks like webform report doesn't support displaying them anyway.
Comment #10
jimbullington commentedThanks for the revision!
I don't really like having another function that duplicates a good bit of the _webform_report_get_columns() function, but I can't think of a better way - without making it messy.
One more thing - what do you think about including hidden fields as well? I was thinking, if the user says All Columns, then we should output all columns. You could just set hidden to false, or just remove it from the _webform_report_get_all_columns() output array.
Comment #11
star-szrRegarding duplicating the _webform_report_get_columns() function, I couldn't think of a better way either, which is why they are separate.
Including hidden fields as well would make much more sense, and that might be where our codebase has to diverge. I'm dealing with a handful of massive multi-page webforms where I need to show only a few columns in the web report, and show almost all the columns in the exports. With the implementation in #9 this is easy to do, because even the end user can specify the fields to be hidden from exports fairly easily. I think the only other way of hiding columns would be (possibly) via custom PHP code.
I will upload a revised patch for you later this week that exports all columns.
Comment #12
star-szrHere is the revised patch. I'm not sure if we need the description for the checkbox on the export CSV form, but I'll leave that up to you.
Comment #13
kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.
Comment #14
vako commentedI would like to have this feature in all versions of webform and committed to code, would it be possible??
Comment #15
kenorb commentedComment #16
kenorb commentedThe patch needs porting to Drupal 7 then.