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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vernond’s picture

Status: Active » Needs review
FileSize
996 bytes

Patch 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.

vernond’s picture

Whoops. 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.

vernond’s picture

We 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.

quicksketch’s picture

Thanks vernond, this looks pretty good. What's your expected behavior when you have nested fieldsets or pages?

vernond’s picture

The 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.

vernond’s picture

A 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.

quicksketch’s picture

Thanks 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.

vernond’s picture

Status: Needs review » Needs work

changing status

DanChadwick’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

There won't be further feature development in the X.x-3.x branches.