I want to convert a ".rdl" report to PDF format using JavaScript and send it with an attachment, the PDF file is attached to the email, but when I send it and open it, the PDF file shows an opening error.
Is there any consideration I should have?
*This post is locked for comments
Hello,
Please refer following url for reference:
ankit.inkeysolutions.com/.../dynamics-crm-2011-creating-e-mail.html
I have also detected that the pdf file that I receive in the email marks the following error:
" Error.
Try this action again. If the problem persists, consult the Microsoft Dynamics 365 Community for solutions or contact your organization's Microsoft Dynamics 365 administrator. Ultimately, you can contact Microsoft Technical Support. "
The "CreateEmailAttachment" function is executed after the encodePdf function
In the email it appears attached, the size is 357 bytes, mail reaches me of 679 bytes.
And this is the code that I use to attach the file:
function CreateEmailAttachment(bdy,emailuno) { var activitymimeattachment = Object(); activitymimeattachment.ObjectId = Object(); activitymimeattachment.ObjectId.LogicalName = "email"; activitymimeattachment.ObjectId.Id = emailuno; activitymimeattachment.ObjectTypeCode = "email"; activitymimeattachment.Subject = "File Attachment"; activitymimeattachment.Body = bdy; activitymimeattachment.FileName = "Enviar Oferta.pdf"; activitymimeattachment.MimeType = "application/pdf";
}
Hi
It might help if you could add some screenshots and possibly the bit of code that downloads the PDF and then attaches to the email.
Normally converting to PDF and attaching it to email is done using Server Side Code either using a plugin or CWA.
If you are doing both of these using JS, please make sure the file size is as expected and also make sure the correct mimetype is set
The following link has a C# example but the approach is still the same if you are converting an SSRS report to PDF.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156