Support

Home Forums Community Forum Reordering the export of event attendees

Reordering the export of event attendees

Posted: December 3, 2013 at 10:10 am


Alex Ryall

December 3, 2013 at 10:10 am

I replied to this article by accident thinking I was on the support forum. https://eventespresso.com/2011/05/drag-and-drop-question-order-sequence

We have chosen the order we wish the questions to appear described in the article above using the drag and drop feature however the spreadsheet export of event attendees appears in a different order. Is it possible to reorder the way the fields are exported? This is because the spreadsheet needs to be imported into another system.

Thanks

Alex


Sidney Harrell

December 3, 2013 at 1:27 pm

I think this line (361 in includes/functions/export.php):

$quest_sql .= " ORDER BY q.sequence, q.id ASC ";

should be:

$quest_sql .= " ORDER BY qg.group_order, q.sequence ASC ";

This should order them by the group order first, then by the question sequence. The first three questions are hard coded in.


Alex Ryall

December 4, 2013 at 2:09 am

Do you mean it will always start with First name, Last name and Email? I have edited the export.php file and it is still not in the desired order.

Thanks

Alex


Sidney Harrell

December 4, 2013 at 9:32 am

Correct. The header for the first name, last name, and email are set on lines 307-309, and the output is on lines 531-533. You could try commenting out those lines, and changing the ignore array on line 364 to an empty array:

$ignore = array();


Alex Ryall

December 5, 2013 at 3:01 am

Thanks that worked, I got it almost perfect now. The last thing I am trying to do is make it so the output contains none of the other fields before the questions. I have managed to remove them all except the first one “Group”. When I delete the line echo $attendees_group it still writes a column of blank entries instead of the groups. Any ideas how I could fix this?

Thanks

Alex


Sidney Harrell

December 5, 2013 at 10:43 am

The code that echoes the answers assumes there are columns before the answers, so it outputs a separator, then the answer. So you could use php’s output buffer to capture each line of output, then trim off the first separator.


Alex Ryall

December 6, 2013 at 3:45 am

That’s a bit beyond by PHP knowledge, I had a look through the code but couldn’t work out what was going on. Would you possibly be able to tell me which line needs changing?

Thanks

Alex


Sidney Harrell

December 9, 2013 at 10:43 am

You would want to start the output buffer before line 545:

ob_start();
foreach ($question_list as $k => $v) {

and then end the buffer after the corresponding closing brace on line 559:

}
$line = ob_get_clean();
echo substr($line, strlen($s));

that last line should strip the first separator off the line and echo it.


Alex Ryall

December 10, 2013 at 2:11 am

Thank you very much for your help.

The support post ‘Reordering the export of event attendees’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso