The Emailer will send one email per feature passed into it.
If you want the SQL results formatted in a table embedded in the email, then you can use the HTMLReportGenerator to create a table. It'll collect the data, format it to a table which you can add to the email message contents as an attribute.
If you want the SQL results attached to the email, then use a FeatureWriter to write out the data temporarily (with a TempPathnameCreator), and have the Emailer attach the file just written (identified by the "_dataset" attribute from the FeatureWriter)
Also, if your SQL Server is set up to send email then I'd personally go with that option, as it can email query results attached as csv.
Hi,
I have tried with HTMLReportGenerator, but my result is getting summed into just one row. Its not breaking the results into separate rows.
Please see attached
Hi,
I have tried with HTMLReportGenerator, but my result is getting summed into just one row. Its not breaking the results into separate rows.
Please see attached
A table in an HTML report will create one row per feature (i.e. row returned by the query), you mention you tried an Aggregator, is that still there? If so, try removing it.
I figured what I was doing doing wrong, i was attaching the aggregator which was messing things up, its all good now, except that the in the email, the tables does not show border. This is regardless of which type of border i select, I examined the html and it seems like they are referencing a CSS file that does not exist anymore, any idea how I can change that?
I figured what I was doing doing wrong, i was attaching the aggregator which was messing things up, its all good now, except that the in the email, the tables does not show border. This is regardless of which type of border i select, I examined the html and it seems like they are referencing a CSS file that does not exist anymore, any idea how I can change that?
I don't think the CSS is missing (but you can check if you write the output to HTML and view that in a browser), most email clients won't load external files.
How good are you with HTML? You can use the XMLTemplater to set up the table yourself. If you include the CSS necessary in the header of the HTML the email client won't need to load anything externally.
Slightly easier option might be to use a StringReplacer on the output of the HTMLReportGenerator and replace
<table>
with
<table border="1">
(1 will be the width of your table border). Technically that's the old style of HTML tables and it should be long deprecated but fortunately most browsers still support it.
Please see attached screenshot, its showing the link from where the htmlreportgenerator is trying to collect the CSS, that link is broken i think. I cant find any way to change it.
Please see attached screenshot, its showing the link from where the htmlreportgenerator is trying to collect the CSS, that link is broken i think. I cant find any way to change it.
Try this:
Write your HTMLReportGenerator output to a HTML file (with the HTML writer) and view that in a browser.
I just tried this "<table border="1">" and that has solved my problem. Nothing else seems to work.