386
Views
7
Comments
Solved
Change name/label when exporting data to excel

Hi


So I have a problem when I want to export data to an excel-file. It's working as expected but what I need to do is to change the final labels that are defined when mapping to my record. It's mapped from a Structure, but a structure can't have ÅÄÖ only a-z.


any idea how I can come around this?


thanks!

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi Steven,

you can make use of the Advanced Excel forge component.

See attached oml for a demo of your use case.  It is set up in such a way that you could reuse action ReplaceExcelHeaders right after RecordListToExcel for every excel you are exporting with swedish characters.

in that demo I'm looking up the first cell with a given value to replace it, which doesn't break when attributes change position in the structure.

Alternatively, you could just write to the cell by location (i.e. passing the column and new name into the ReplaceExcelHeaders instead of old name and new name) in case you are more worried about accidently replacing any other cell in the sheet that is not a header.

Dorine


QDR_ExcelUnusualHeaders.oml
2022-10-17 18-34-06
Steven Erixon

Thank you Dorine. Let me check this today and come back if I can find a solution with it!


Best regards, Steven.

2022-10-17 18-34-06
Steven Erixon

Sorry for the late reply. This was a way to solve the problem, however I did it in another way!


thank you for taking time of your day to help me.


Best regards, Steven.

2021-08-12 05-19-40
Shubham Janbandhu

Hi Steven, 

Could you provide some examples and elaborate more realated to labels and columns.

Regards, 

Shubham


2022-10-17 18-34-06
Steven Erixon

https://success.outsystems.com/Documentation/How-to_Guides/Data/How_to_customize_the_export_to_Excel?_gl=1*1y26pge*_ga*MjAwNzI3OTg3My4xNjQ5MzM4NDIy*_ga_ZD4DTMHWR2*MTY2MjA0MzA5NS44Mi4xLjE2NjIwNDMzMzguMjcuMC4w


scroll down to where it says "answer" and you can read about how the structure sets the name of the labels. Since it's a structure I can't name anything outside of a-z 1-9. I need a workaround on this because the output in the excel-file will have some special signs like Å Ä Ö. Example is Från, Måndag etc. Right now it's Fran and Mandag because of the limitation with naming a structure.

2021-08-12 05-19-40
Shubham Janbandhu

So you need labels like Från, Måndag instead of Fran, Mandag and want to use these special characters Å Ä Ö for labels. Is it?

If I am not wrong, could you tell us why you want labels like this, because I have never gone through such a requirement, yes it would be different if want to edit records in the excel sheet.

Regards,

Shubham

2022-10-17 18-34-06
Steven Erixon

Exactly. It's because I want the attributes to be written in Swedish and not English when I export my excel file.

I am creating a web application in swedish so it would make sense if everything is in swedish and not have some parts in english for the people using this application.


thank you! :)  

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi Steven,

you can make use of the Advanced Excel forge component.

See attached oml for a demo of your use case.  It is set up in such a way that you could reuse action ReplaceExcelHeaders right after RecordListToExcel for every excel you are exporting with swedish characters.

in that demo I'm looking up the first cell with a given value to replace it, which doesn't break when attributes change position in the structure.

Alternatively, you could just write to the cell by location (i.e. passing the column and new name into the ReplaceExcelHeaders instead of old name and new name) in case you are more worried about accidently replacing any other cell in the sheet that is not a header.

Dorine


QDR_ExcelUnusualHeaders.oml
2022-10-17 18-34-06
Steven Erixon

Thank you Dorine. Let me check this today and come back if I can find a solution with it!


Best regards, Steven.

2022-10-17 18-34-06
Steven Erixon

Sorry for the late reply. This was a way to solve the problem, however I did it in another way!


thank you for taking time of your day to help me.


Best regards, Steven.

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