140
Views
4
Comments
Solved
Add a custom string or a text to column when using RecordListToExcel
Application Type
Reactive

Hello all.

Context:
I'm trying to export data that I have currently on screen. I'm able to convert the data into excel. But i'm stuck at adding a custom text to a column when exporting.

Problem:
Is there any way to add a custom string or a text to a certain column while creating excel file?


From the image above, you can see that there is a percentage and a euro text. But when I export this data to excel, percentage and euro do not come. 


Reason behind this is, both the text(percentage and euro) are concatenated when displayed in the table. (refer below images)


I might have to use forge component, but I don't want to. Is it possible?


Thanks,

Aman

2024-04-15 16-08-47
Aman Devrath
Solution

Hello,

I was able to solve this by Using Cell_Write from Advanced Excel component.

Steps:
1. Create a variable (mine is : rowNo_CellWrite) with default value as 2 (because 1st row is headers).
2. Since I know that I have to write in E column, I concatenated "E" + rowNo_CellWrite.
3. Use for loop and looped through the same record list that you are using to write in Excel file.
4. Pass the value from Record List and looped it until all records are written in E column.
5. Add 1 to your variable to make loop through entire column. (For eg. E2, E3, E4, E5 .. etc)

I did the same for euro currency symbol. This worked perfectly. 

PS: You can see you have to hard code the column name. Until there's a different way, use this.


Thanks,

Aman Devrath

2018-08-27 08-29-35
Fábio Vaz

Hello Aman,

I think the only way is use the Advanced Excel or some asset to allow you to manipulate the Excel.

https://www.outsystems.com/forge/component-overview/355/advanced-excel


You check all the types? And you try change the type to Text instead of Int or decimal (this solution isn't perfect)? 

2024-04-15 16-08-47
Aman Devrath

Hello @Fábio Vaz ,

Thank you for the suggestion.
I tried using Advanced Excel but still the problem persists. I'm first writing data using Cell_WriteRange and then maybe i have to pick the column where I have to add percentage and currency symbol and then write again column-wise. 

This will be tedious process or I don't know if it's possible. I'll try something else.

Again, thank you for the help.


Aman

2023-01-17 13-43-47
Akhila K Soman

Hello @Aman Devrath ,

You can achieve it by using attribute with Text datatype.

Create a structure with the needed attributes and set the datatype of the attributes that you wan't to modify to text.

Here the structure attribute Marks is of Text datatype. It is modified to get the required string and is exported to excel.


Result:

Hope this helps.

Thanks,

Akhila

2024-04-15 16-08-47
Aman Devrath
Solution

Hello,

I was able to solve this by Using Cell_Write from Advanced Excel component.

Steps:
1. Create a variable (mine is : rowNo_CellWrite) with default value as 2 (because 1st row is headers).
2. Since I know that I have to write in E column, I concatenated "E" + rowNo_CellWrite.
3. Use for loop and looped through the same record list that you are using to write in Excel file.
4. Pass the value from Record List and looped it until all records are written in E column.
5. Add 1 to your variable to make loop through entire column. (For eg. E2, E3, E4, E5 .. etc)

I did the same for euro currency symbol. This worked perfectly. 

PS: You can see you have to hard code the column name. Until there's a different way, use this.


Thanks,

Aman Devrath

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