0

I am using Nathan Pitman's Reports module to allow our client to export some custom information. I wrote up the SQL query and it works great. The only issue I have is that the first row (the header row) uses numbers for the column names, like shown here: http://cl.ly/image/3U2O451s1F3y I'd like to make those show as proper headers that make sense to the client. (For example: Member Group, Email, First Name, Company, etc.)

The Reports module does allow for post-processing but that is where I'm lost. I have no idea how to properly write the PHP to change the header row to what I need the column titles to be. I'd really appreciate some help here.

Query:

SELECT 
      exp_member_groups.group_title as 'Member Group',
      exp_members.email as 'Email', exp_members.username as 'Username', exp_members.screen_name as 'Screen Name',
      exp_channel_data.field_id_13 as 'First Name', exp_channel_data.field_id_14 as 'Last Name',
      exp_channel_data.field_id_68 as 'OCB Member ID', exp_channel_data.field_id_59 as 'Company'
    FROM exp_channel_data
    JOIN exp_channel_titles ON exp_channel_data.entry_id = exp_channel_titles.entry_id
    JOIN exp_members ON exp_channel_titles.author_id = exp_members.member_id
    JOIN exp_member_groups ON exp_members.group_id = exp_member_groups.group_id
    WHERE exp_channel_data.channel_id = '6'
    AND exp_members.group_id = '11'
    OR exp_members.group_id = '10'
    OR exp_members.group_id = '9'
    OR exp_members.group_id = '8';

Thanks!

3
  • Can you post your SQL query here for reference? Jan 31 '15 at 11:53
  • Yep - edited my question to include it.
    – A Herrera
    Jan 31 '15 at 16:32
  • Thanks Angie, I think I have a project which I've used Reports on more recently where I noted an issue with column names not being output correctly, I'll grab the source from there and merge it back into the current release on Github at some point today... Feb 1 '15 at 13:41
0

Ok, try a fresh download from https://github.com/nathanpitman/reports.mod.ee_addon and see if that works... :)

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.