The current results download does not include parent component name in column headings. This makes it difficult to read spreadsheets where there are groups of repeating component sets within fieldsets.
Illustration:
Person 1 Fieldset contains name, surname, email address;
Person 2 Fieldset contains name, surname, email address;
:
:
Person x Fieldset contains name, surname, email address.
When you download results and scroll across you lose sight of which email address column relates to which person number, because all you see is:
Name|Surname|Email|Name|Surname|Email......Name|Surname|Email
We should put parent component name in column header[1] so that we can see the groupings as we scroll across the spreadsheet.
D7 patch follows (D6 when we're happy with D7).
Comment | File | Size | Author |
---|---|---|---|
#3 | webform-7.x-3.x-addparentheading-1436790-4.patch | 1.44 KB | vernond |
#2 | webform-7.x-3.x-addparentheading-1436790-3.patch | 1.41 KB | vernond |
#1 | webform-7.x-3.x-addparentheading-1436790-1.patch | 996 bytes | vernond |
Comments
Comment #1
vernond CreditAttribution: vernond commentedPatch attached.
Parent component name appears in row above first component in the group.
I have purposely not made this a config option because that seems like a silly overhead and I cannot think that adding this change will break any existing applications in any way.
Comment #2
vernond CreditAttribution: vernond commentedWhoops. It worked as expected on three forms and then got dodgy on a fourth. Sometimes the parent heading will appear multiple times with patch in #1 (when Position is defined).
This patch fixes the issue.
Comment #3
vernond CreditAttribution: vernond commentedWe also need to differentiate between two types of returned header arrays. Grid, select and file return nested arrays, other components return a single array.
This patch seems to do the job on the most demanding forms I have going at the moment.
Comment #4
quicksketchThanks vernond, this looks pretty good. What's your expected behavior when you have nested fieldsets or pages?
Comment #5
vernond CreditAttribution: vernond commentedThe intent (and expected behaviour) is just to have the components (grouped or singly, depending on form design) immediate parent named as an aid to contextualise what one sees in the report.
Comment #6
vernond CreditAttribution: vernond commentedA shortcoming of this patch is that we overwrite the first instance of additional headers provided by "multi-level" components such as grid and file. I'll take another poke at this when I need a diversion from more pressing issues.
Comment #7
quicksketchThanks vernond, nice catch. If this causes trouble, perhaps a good alternative approach would be #298784: Run CSV downloads through theme functions, which would hopefully allow end-users to theme their CSVs however they liked.
Comment #8
vernond CreditAttribution: vernond commentedchanging status
Comment #9
DanChadwick CreditAttribution: DanChadwick commentedThere won't be further feature development in the X.x-3.x branches.