42
Views
10
Comments
[OutSystems Data Grid] How to export excel without html in column data grid?
Question
outsystems-data-grid
Reactive icon
Forge asset by OutSystems

I have created tag in the data grid's column using html & CSS. 

When using the data grid function for exporting to excel, it will displayed the line of html code...


How can I export to excel without the html code, but only show On Time, Pending, Overdue & Late submission in the excel??

Thank you


2019-01-31 08-54-57
André Costa
Champion

Hi @JWLoo 

When assigning the value to the Excel structure, you can extract the status name by following this approach:

Separating StartIndex and EndIndex can help with readability and debugging. However, if you prefer, you can also handle this in a single line of code.

Hope this solves your problem! Reply if you need help to understand this.

AC

UserImage.jpg
JWLoo

Hi @André Costa, thank you. But if I'm using the data grid's built-in export to excel function with java script, then where can put the logic that u suggested?

Java script: 


2019-01-31 08-54-57
André Costa
Champion

You can include the logic in the flow right before saving the data.

If you need more specific information, please share your oml, so I can assist you

2024-12-02 13-16-47
Vipin Yadav

Hi @JWLoo,
You can create a Server Action in OutSystems to remove HTML tags from text. Here is a simple example using the regex replace function 

Server action: StripHtmlTags 

Input: HtmlText(text) . 

Output: CleanText(text) . 

CleanText = Regex_Replace(HtmlText, "<[^>]*(>|$)", "", RegexOptions.IgnoreEntry|RegexOptions.Multiline); 

This function can be called before the export data is loaded into Excel to remove any HTML tags.

Thanks,

Vipin Yadav

UserImage.jpg
JWLoo

Hi @Vipin Yadav, thanks for replying me. But if I'm using the data grid built-in export to excel function with java script, then where can I place this StripHtmlTags server action?

Java script: 

2024-07-12 05-57-50
Gourav Shrivastava
Champion

Hello @JWLoo ,

I would like to suggest to please share the OML file of your application so that community members can easily help you.

Thanks 

Regards Gourav Shrivastava

2024-02-14 09-44-45
Omar Abd elkefi

Hello @JWLoo ,

can you try loading this js script into your application?

<script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise/dist/ag-grid-enterprise.min.js"></script>

and then try using this function 

gridOptions.api.exportDataAsExcel();

Regards.

UserImage.jpg
Sudharshan T

Hi Eveyone,

I'm facing the same issue, do we have any inputs on thisp. Avoid html while exporting the grid data using default data grid export using Javascript.

2024-08-28 10-01-54
Kiran Shinde

Hello @JWLoo & @Sudharshan T  

I had the same requirement for the status column, and this script resolved my issue. Just follow these steps: 

1. Create JavaScript in app with JS

line no 10 has colSpan condition just in case you are using that column in grouping 

2. Then add that created script in block/screen of grid as required scripts

3. On click of export user JS


2022-11-12 11-28-30
Gonçalo Martins
Staff

Hello @JWLoo,

To make this more collaborative and to make sure the community is looking into the same use case that you're reporting, please share a sample oml where that can be reproduced and please indicate the steps to reproduce the scenario you mentioned (include a GIF/video if it's easier).

Cheers,
GM

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