Skip to main content
Question

htmlreportgenerator and emailer

  • October 30, 2019
  • 11 replies
  • 233 views

Forum|alt.badge.img

I don't see the grid in email body when I use table in htmlreportgenerator and emailer

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

11 replies

Forum|alt.badge.img
  • Author
  • 13 replies
  • October 30, 2019

try to show table in body of email. i see all information i need but no grids. would you help me out. thank you in advance


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • 1442 replies
  • October 31, 2019

Hi @knfme2019,

Make sure the Table Style is set to bordered.


Forum|alt.badge.img
  • Author
  • 13 replies
  • October 31, 2019

Thanks Itay. I did use bordered. I can see the grids if write to HTML format.

in this case, I would like to have in email.

I use emailer and body is html_content

 

this is html writer- which looks good

 


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • 1442 replies
  • October 31, 2019

Thanks Itay. I did use bordered. I can see the grids if write to HTML format.

in this case, I would like to have in email.

I use emailer and body is html_content

 

this is html writer- which looks good

 

There is probably something happening when displaying the html in de mail, I am not sure there is much you can do about it....

You could send the table as a xls attachment....


mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • October 31, 2019

Thanks Itay. I did use bordered. I can see the grids if write to HTML format.

in this case, I would like to have in email.

I use emailer and body is html_content

 

this is html writer- which looks good

 

And can you look at html_content in the Data Inspector or a text editor, to see if the border is being properly set? As Itay says, it may be a display issue in the email client.


Forum|alt.badge.img
  • Author
  • 13 replies
  • October 31, 2019

yes, it' set to bordered. it also look good in Preview in Browser though. maybe in email client. thanks Mark


I have the same problem here.. it's set to bordered but in outlook it doesn't show the borders.

 

@knfme2019 did you ever find a solution to this problem?


Forum|alt.badge.img
  • Author
  • 13 replies
  • June 11, 2020

I have the same problem here.. it's set to bordered but in outlook it doesn't show the borders.

 

@knfme2019 did you ever find a solution to this problem?

No, Alex! I have to do something else so never have time getting back to this matter


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • June 12, 2020

I've looked into this and found that if you set the table style to bordered in the HTMLReportGenerator it references an external CSS library:

<!DOCTYPE html>
<html>
   <head>
      <title>Test</title>
      <meta charset="UTF-8">
      <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
   </head>
   <body>
      <table class="table table-bordered">
         <thead>
            <tr>
               <th>Attribute1</th>
               <th>Attribute2</th>
               <th>Attribute3</th>
            </tr>

The thing is that most (all?) email clients don't allow external CSS.

So... if you want to be able to control this you can use a StringReplacer to replace that <table> tag like this:

0684Q00000ArLO8QAN.png

Alternatively you can use it to take out that <link...> tag and replace it with a <style></style> block containing your CSS, but you'd have to know CSS for that. And for full control you can ditch the HTMLReportGenerator entirely and code the whole thing using an XMLTemplater, using inline CSS. 


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3699 replies
  • June 12, 2020

I have the same problem here.. it's set to bordered but in outlook it doesn't show the borders.

 

@knfme2019 did you ever find a solution to this problem? 

I've looked into this and found that if you set the table style to bordered in the HTMLReportGenerator it references an external CSS library:

<!DOCTYPE html>
<html>
   <head>
      <title>Test</title>
      <meta charset="UTF-8">
      <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
   </head>
   <body>
      <table class="table table-bordered">
         <thead>
            <tr>
               <th>Attribute1</th>
               <th>Attribute2</th>
               <th>Attribute3</th>
            </tr>

The thing is that most (all?) email clients don't allow external CSS.

So... if you want to be able to control this you can use a StringReplacer to replace that <table> tag like this:

0684Q00000ArMjfQAF.png

Alternatively you can use it to take out that <link...> tag and replace it with a <style></style> block containing your CSS, but you'd have to know CSS for that. And for full control you can ditch the HTMLReportGenerator entirely and code the whole thing using an XMLTemplater, using inline CSS. 


  • 2 replies
  • May 8, 2023

A workaround for this issue, is to insert the style yourself in as CustomHTML element within the HTMLReportGenerator

for instance:

<style>

th {

  font-weight:bold;

  color:#ffffff;

  background-color:#009530;

  cursor:pointer;

}

td {

  font-weight:normal;

  color:black;

  border: 1px solid black;

}

</style>