Hi all,
I´m trying to create a function wich automatically open outllook and in the body of the e-mail puts a message (example a sales document) with the format layout of one Report.
I see the version 2009 have a function called SaveAsHTML and you can do:
[Ok :=] Report.SAVEASPDF(Number, FileName[, Record]) [Ok :=] Report.SAVEASPDF(FileName)
But you can´t use this function in NAV2016 because is deprecated and launch error in execution time. How i can do this in new version?
Thanks!
[Ok :=] Report.SAVEASPDF(Number, FileName[, Record]) [Ok :=] Report.SAVEASPDF(FileName)
*This post is locked for comments
i wouldn't know how to use xslt :)
Is there an example somewhere i can use in nav?
Or maybe another "easy" option:
SAVETOXML and then use XSLT to transform it to HTML
Hi Bert,
Yes, but it's no easy.
Easy option:
If the Report isn't very complex you can use the automation of word to generate a HTML and use this to send the e-mail. I`m try this option, is relative easy but, don't work so good if the report is complex so I discart this option.
Complex option
My Report is really complex and the format of html word automation don't work really good.. The solution was create a Dll with .NET. This DLL retrieves for NAV the Report saved as pdf and the DLL open Outlook and place and attach the report as image.
I can place here the example of C/AL code to see the example of call but i can`t place here the dll or .net proyect because porperty of my Company.
Wait for your answer.
Regards.
hi CristianAguerre,
did you find a good solution to your problem? i'm currently having the same problem.
Thanks for replys and possible solutions,
At this moment i´m searching more possible ways to do this.
When this fact will update the post with the develop solution.
Thanks.
Agreed with Suresh, easiest way it to use a API. Or else you can write a module to handle your requirement. We have already developed such a module for one of our client.
In that what we do is we have HTML template files saved in the common location in the server and depending on the report system pick the HTML template and then replace the values of the HTML file.
As example
%1
Dear %2,
This is to inform you that your payment of %3 is ready and please be kind enough to contact %4 for more information.
Thank you.
During the process system replace the values of the file with the rec values.
One thing you could try is to find an API which will convert the PDF to html and then use that HTML in your email body format. Quick search on google got couple of API's but unfortunately they are not free, not sure if you are willing to spend few bucks.
No :(
Thanks Mohana Yadav :(
Do You now if it`s possible to force use a deprecated function, for example the function SaveAsHTML in NAV2016?
got it. there is no suck functionality available in standard NAV
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