I want to create mail body from Data Table and the design should be exactly same shown in screenshot.
Please refer attached excel file.
createMailBody.xlsx (9.0 KB)
I am looking for your help.
Note: Please don’t suggest looping option
Yeah i have tried it but i also want some colour specific columns i stuck there.
How we can put the condition to colour some of the columns and rows, the way i have shown in screenshot?
I can see row & column headers are coloured in above Screenshot.
<th> tag for both of those headers and add CSS for
<th> html tags
How to write condition as first column do not have background color but other have?
Similar way first cell of each row have color but other don’t.
Can you please share Linq ?
I don’t have ready linq expression with me.
But you can try below steps.
- Take clone of existing datatable - ColorDT.
- Use linq and get x,y index if each cell. Call VB method to get background colour from excel sheet for that XY value. Update corresponding cell in ColorDT with colour code
- Now you have 2 DTs. One with actual values and other with corresponding colour value in cells
- Put some logic and update HTML cell style property
Used looping concept as their were other validations and i have to color cells on the basis of values but will try this someday
For now I am closing this question.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.