Title:
Report.SaveAs HTML error – “The Html output format is not supported by the current report layout format” when sending Remittance Advice from Job Queue
Product:
Dynamics 365 Business Central (v27)
Scenario:
I created a custom Job Queue codeunit to automatically send Vendor Remittance Advice emails.
The report has both RDLC and Word layouts.
My goal is:
-
Generate PDF from RDLC for attachment
-
Generate HTML from Word layout for the email body
However, when the Job Queue runs, I get the following error:
The Html output format is not supported by the current report layout format.
"Remittance Advice Job Qu. Mgmt"(CodeUnit 50103).SendRemittance line 43
"Remittance Advice Job Qu. Mgmt"(CodeUnit 50103).OnRun line 15
"Job Queue Start Codeunit"(CodeUnit 449).OnRun line 18
"Job Queue Dispatcher"(CodeUnit 448).HandleRequest line 26
Report Setup
-
Report ID: 50105 (Customized copy of Standard Send Remittance Advice from Vendor Ledger Entry)
-
Layouts available:
-
RDLCRemittanceAdvice (RDLC)
-
WordRemittanceAdvice (Word)
-
Report Selection Setup
Usage: Vendor Remittance – Posted Entries
-
Use for Email Body = Yes
-
Use for Email Attachment = Yes
-
Email Body Layout = Remittance Advice Entries (Word)
-
Report Layout = RDLCRemittanceAdvice
Code snippet
TempBlobBody.CreateOutStream(OutStrBody);
Report.SaveAs(
ReportID,
'',
ReportFormat::Html,
OutStrBody,
RecRef
);
TempBlobBody.CreateInStream(InStrBody);
InStrBody.ReadText(EmailBody);
This works for PDF generation, but it does not read data and create email body, but the HTML generation throws the error.
Questions
-
Does
Report.SaveAs(..., ReportFormat::Html, ...)support RDLC + Word layouts in Job Queue? -
Is there a recommended approach to generate the email body from the Word layout?
Any guidance would be appreciated. Please Answer as soon as possible.

Report
All responses (
Answers (