681
Views
8
Comments
Export to Excel File with a Neat Column Header
Hi everyone,

I would like to share my way on how to export an excel file with a neat column header. Maybe some may have done it already, but it's worth sharing to those who cannot achieve it.



Ju-chan
2011-09-30 16-44-42
João Fernandes
Hi Ju-chan,

Just for reference, you can also change the Label property of the attributes to change the header of the excel.
Check the documentation here
2020-03-05 15-52-45
André Vieira
Staff
Nice Job Ju-chan!

Do you really need to duplicate the list though?

Cheers,
André
2015-04-07 21-32-04
Julius King Chua
@Joao Fernandes: Well, I haven't seen that part, so I won't argue. Thanks too for the reference. ;)

@André Vieira: Maybe no or it depends on the situation. :)
2014-04-28 10-19-39
Wayne Hodgson

Nice Job Ju-chan!

I also have a need to specify different column headers in multiple excel exports.  I noticed your solution here after noticing a problem with my attempted solution.  Where you have a ListDuplicate in your solution, I have placed a Query.  I have done everything else the same. My problem is that when I view the exported excel file, the last record in the excel file overwrites the first record in the excel file.  I then have the last record as the first and last record and do not get my correct first record.  Any suggestions, or have you experienced that same problem?
2014-04-28 10-19-39
Wayne Hodgson
Wayne Hodgson wrote: Just as a follow up to my original post for anyone that may read this in the future, I was able to use an advanced query and specify an output structure which enabled me to rename the column headings exactly how I wanted them named in the excel file.  Now my excel file is correctly constructed without missing or duplicated records.

Nice Job Ju-chan!

I also have a need to specify different column headers in multiple excel exports.  I noticed your solution here after noticing a problem with my attempted solution.  Where you have a ListDuplicate in your solution, I have placed a Query.  I have done everything else the same. My problem is that when I view the exported excel file, the last record in the excel file overwrites the first record in the excel file.  I then have the last record as the first and last record and do not get my correct first record.  Any suggestions, or have you experienced that same problem?
 
 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
As a note to Wayne's remark about the last record overwriting the first, this typically happens in case you use the List.Current of a List in the ListAppend to that same list (so that you append the List.Current to the List). Always use a separate record variable of the same type as the record list, then ListAppend that record to the list.
2021-06-09 13-39-18
Agno Silveira
 
MVP
Boa tarde, 
Alguem poderia passar um exemplo do fluxo parecido com o criado pelo Julius King Chua.
Porém, para exportar uma recordlist para txt (notpad) e fazer download.

Obrigado
2023-05-16 02-25-49
Xiao Hui

Hi Julius


Thanks for your solution! Finally I can arrange and rename the column header nicely. I am using Aggregate in to generate my record list. Last time, I need to redo in AdvancedSQL which is very tedious. 

I hope Outsystems can improve in this export function with Aggregate!

Thanks.


-Xiao Hui-


Julius King Chua wrote:

Hi everyone,

I would like to share my way on how to export an excel file with a neat column header. Maybe some may have done it already, but it's worth sharing to those who cannot achieve it.



Ju-chan



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.