A couple of questions for the gurus...
I've noticed that when I generate a report, I can click SEND -> report by email, and generate an HTML Email.
Is there a way to automate this. I need to schedule a report to run every night, and I would like to send it by email if I could.
Also - I'm trying to find information how to programmatically call a report with filters. I've read up on the REPORT.Run command, but I'm not sure I understand how to apply the filters to the report.
Thanks!
0
Comments
I'm putting together a quick scheduler that will call codeunits. Nothing fancy. I'm going to use it to call my report and have it print to a pre-defined printer.
I would still like to be able to send the report by email from the codeunit if anyone can help me on that...
although if you do a search, you should find a lot of info on it, as this is one of the most asked questions on here.
your basic approach is going to be to get a pdf printer driver that can accept input programitically and then add some code to the report to send the info to pdf printer.
Here are a few examples of pdf printer people have recommended
http://www.altusbusinesssolutions.com/
http://www.pdf995.com/
good luck
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
Yeah - I had thought about falling back on the old CDO through automation, but I'm not that far along in C\AL yet.
Sorry if I’m not have explained correctly about the component.
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
I guess I could write something quickly in .Net and expose it to COM... of course... System.Web.Mail is just a wrapper for CDO
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
I've written a code unit that runs my report with the settings that I would like.
I've REPORT.SAVEASHTML to save the report into a working file in the \client directory, and it's working great.
What I'm trying to do now is to use CDO to send the resulting HTML File, but I'm getting an error. I'm attaching the code below.
Conf is my CDO.Configuration. MSG is my CDO.Message. I've added the appropriate Automation objects to my code unit as these variables. Anything that says 'cdo...' as an item indexer is set up as a Text Constant with the Microsoft CDO Schema definition as the text.
The error I'm getting when I try to compile the code unit is
When I press 'OK', the cursor is on the line with Msg.To property.
Any ideas?
[EDIT] - nevermind. I changed msg.To to msg."To", and it allowed it to compile.