Support

Home Forums Event Espresso Premium Custom CSV report add a blank column with title to report

Custom CSV report add a blank column with title to report

Posted: March 7, 2019 at 3:07 am

Viewing 8 reply threads


Kerry Gray

March 7, 2019 at 3:07 am

Hello,

Trying to code our own CSV report to download the columns we need for our events and add in some that are only used on the day of the event, but are not questions on the registration form, is this possible?

I know __( ‘Age’, ‘event_espresso’ ), adds a the age question would
__( ‘ECG’, ” ), add a new column with not expecting to find any data?


Tony

  • Support Staff

March 7, 2019 at 3:42 am

Hi there,

Yes, it’s possible, what code are you using currently? Can you post it to something like Pastebin and then post the URL so we can view it?

I know __( ‘Age’, ‘event_espresso’ ), adds a the age question would
__( ‘ECG’, ” ), add a new column with not expecting to find any data?

It depends where that code is so I’ll need to see what you are doing, one thing I can tell you is you likely don’t need the __() function wrapping your column name as that’s used for translations and if your adding it directly, you likely don’t need to translate it.

If you can post your code I can give you an example of how to add your custom columns.


Kerry Gray

March 7, 2019 at 3:59 am

Hi Tony,

This is what I have so far. https://pastebin.com/icMZnnyh

Noted about the __() I am still getting my order sorted.

Thanks for looking at this.


Tony

  • Support Staff

March 7, 2019 at 4:40 am

Yeah, that function works fine, I’ve just added it to a test site to confirm and the additional columns are shown in the CSV, is it not working for you?

Just to explain a little further on the __() function mentioned before, on line 15 you have __( ‘ECG’, ” ) but you can just use 'ECG', if preferred.


Kerry Gray

March 7, 2019 at 4:59 am

Hi Tony,

Sorry no I have not tested it yet, I was just checking before testing it as I didn’t want to break the website.

Great the I can add the extra columns. Will this mean that if a question hasn’t been asked on a reg form it will not be included in the export?

Thanks


Tony

  • Support Staff

March 7, 2019 at 5:07 am

Sorry but I’m not sure I follow.

If you haven’t asked that question during the registration, then no it will not be included in the Registration Report. The additional columns you are adding will be included as blank fields, like this – https://monosnap.com/file/Zx2ZSQ43fVDhXZNuFtXJiYGbM98urK

I obviously don’t have the answers to your reg form question on my report so I get a lot of blanks, but that’s how it will be exported.

Is that what you are looking for?


Kerry Gray

March 7, 2019 at 5:11 am

Hi Tony,

Yes, that has answered the question. Brilliant! This is a shot in the dark question but is it possible to Name the column additionally to the header eg rather than Column A1 being named A1 it is actually called Attended. Don’t worry this isn’t vital and might be something we have to get a developer for. Thanks for your assistance.


Tony

  • Support Staff

March 7, 2019 at 5:30 am

So you mean naming the columns in the editor whatever the first row is for that column?

A = Attended, B = Ticket Name and so on

Meaning you have Attended row 1 Ticket Name row 1 etc?

If so then no, at least not within the CSV itself as the export is a plain CSV with the first row being the column headers so the actual name of the columns themselves would actually be a feature of the spreadsheet editor and we can’t define that within the CSV. We also can’t add specific editor functions to it, meaning if there was a way to do this in the CSV specifically for MS Exel (I don’t think there is), its not a feature we would add to core as not everyone uses it.

IIRC, with MS Excel there is a function that allows you to set the first row as the column names, but for the life of me I can’t find it now so that’s something you’ll need to check (it may have been part of an add-on I use for Office, which I don’t have active currently and is why I can’t find it). It will also depend on the editor your use, for example if you are using OpenOffice it may or may not have that functionality.


Kerry Gray

March 7, 2019 at 7:06 am

Hi Tony,

Thanks for the advise. Will research what you have suggested.

Thanks

Viewing 8 reply threads

The support post ‘Custom CSV report add a blank column with title to report’ 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