How to export a report as HTML
I have a workflow where I want to create a report, and then send it by email. This should be very straightforward, using a TemplateReport and SendMail activity.
However, when I set the report's Output Format to Geocortex.Reporting.ReportFormat.Html, the output is actually in RFC822 format, with the HTML embedded as multipart/related. This obviously cannot be used as the email body.
When I export the report directly from the Report Designer, the output is just plain HTML.
How to fix this?
Here's an example of the output of the TemplateReport activity:
Content-Type: multipart/related;
boundary="----=_NextPart_596_9308_56F06B03.19B8C155"
Content-Transfer-Encoding:
From: <Created by Data Dynamics>
Subject: ARNet Document
Date: maandag 17 juli 2017
MIME-Version: 1.0
This is a multi-part message in MIME format.
------=_NextPart_596_9308_56F06B03.19B8C155
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
Content-ID: d11349d6-037f-4284-a0bd-5eead9ff1a79html
=EF=BB=BF<html>
<head>
<title>
ActiveReports Document
</title><meta HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=
=3Dutf-8" />
</head><body leftmargin=3D"0" topmargin=3D"0" marginheight=3D"0" marginw=
idth=3D"0">
<style>
@page{size: 8.5in 11in;margin-top:1in;margin-left:1in;margin-right:1in=
;margin-bottom:1in;}
</style><div style=3D"page-break-inside:avoid;">
<div style=3D"position:relative;width:6.5in;height:9in;">
<span style=3D"position:absolute;top:0.01388884in;left:0.07638884in;w=
idth:6.298611in;height:0.1736111in;font-family:Arial;font-size:10pt;color:#=
000000;vertical-align:top;"><nobr>Incident</nobr></span>
</div>
</div>
</body>
</html>
------=_NextPart_596_9308_56F06B03.19B8C155
0
-
Hi Berend,
It does look like it is doing something funky by having a multipart line response.
Have you tried using an image instead? You could embed or attach an image of the report to the email. PDFs are the most common.
If you would like us to take a deeper dive into this, I would suggest opening up a support case so we can take a better look.
Thanks,
Ali0 -
Hi Ali,
Thanks for your response. For now I changed the report type to PDF, and I add that as an attachment to the email. However, I'd really prefer the mail body to contain the actual report, so the recipient does not need to open an attachment.
Berend0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare