Answered by:
How to send MS CRM reports in pdf format in email automatically?

Question
-
I need to send reports generated in MS CRM 2011 Online to a bunch of CRM users on a weekly basis. The reports should be delivered in the email as pdf files. I have the reports setup in the CRM and currently I export them in PDF formats and send the PDFs as attachments to a mail, manually to the users, on a weekly basis. I need the whole process to be done automatically. I believe this can be done by using SSIS or windows services. But, I am not sure how to approach the issue. I have never worked in SSIS before and would really appreciate it if someone could guide me through the steps.
Regards,
Ankur
Thursday, June 16, 2011 8:13 PM
Answers
-
Thanks for the reply Jamie. I spoke to Microsoft Tech Support and here is what I am planning to do finally, based on their suggestion. I will create a web-service to sync the data from the CRM data-server to a local SQL server and then run the reports off the local server and send the mails from the server. Do you think it will work?
- Marked as answer by Jim Glass Jr Wednesday, June 22, 2011 4:47 PM
Tuesday, June 21, 2011 2:53 PM -
Yes that will work. It will involve getting really cozy with the SDK though to set up the sync. Or you could use a third party tool like Scribe.
Link to the SDk. I cover a lot of SDK stuff in my blog too that is linked in my signature.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=420f0f05-c226-4194-b7e1-f23ceaa83b69
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!
- Proposed as answer by Jamie MileyModerator Wednesday, June 22, 2011 2:00 PM
- Marked as answer by Jim Glass Jr Wednesday, June 22, 2011 4:47 PM
Wednesday, June 22, 2011 2:00 PMModerator
All replies
-
That will be a fun nut to crack. I wish I was working for you so I could develop this. Here is an example of how you can spit them out in PDF. This was for 4.0, and I haven't tried this for 2011.
Then once it's in PDF you could add it as an attachment as a byte stream or by some other means. I would suggest looking at the CRM SDK. There are several messages in the web services for sending emails. it will involve creating an email and associating it with an activitymimeattachement you will have to create programatically. I think the body attribute of the attachment will have to be set to a base-64 encoded string or something to that effect. Then you can use the sendemailrequest after that is all set up or you could also use the BackgroundSendEmailRequest.
http://msdn.microsoft.com/en-us/library/gg309482.aspx - list of requests, do a search on the page for email to find those relevant.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=420f0f05-c226-4194-b7e1-f23ceaa83b69 - linke to 2011 SDK
Good luck!
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!Thursday, June 16, 2011 8:35 PMModerator -
Hey Jamie,
Thanks for the reply. I tried using the link to guide me through the steps but I am not sure if I can publish a report for external use in "MS CRM 2011 Online". There is no such option in the Action menu. If I understand correctly, I need to publish the report in order to avoid the GUID issue. Anyways, here is what I tried(and plan to do) but haven't really achieved the end goal yet.
1. I downloaded and saved the CRM report into the server as through FetchXML.
2. In BIDS I tried deploying the report onto the sql server but it failed with the following error message,
"Error 1:An attempt has been made to use a data extension 'MSCRMFETCH' that is either not registered for this report server or is not supported in this edition of Reporting Services."
It seems like I need to install "Microsoft Dynamics CRM 2011 Fetch Authoring Extension" to get rid of this error.
I think once I have that, I can have the report reside in the SSRS and send the mail directly from the SSRS as pdf files.
I don't really need to send the mails from the CRM as long as the reports are running against the CRM data and are up to date.
Do you think I am moving in the right direction?
Regards,
Ankur
Sunday, June 19, 2011 10:31 PM -
Based on the error, I think you need to install the CRM Reporting Services extensions on the Report Server, rather than installing the Fetch Authoring Extension on the BIDS machine
Microsoft CRM MVP - http://mscrmuk.blogspot.com http://www.excitation.co.ukMonday, June 20, 2011 5:11 AMModerator -
Thanks for the input David !! But, I am not sure how to install the CRM Reporting Services extension for the online version of CRM 2011. Would you know how to do that?
Regards,
Ankur
Monday, June 20, 2011 4:44 PM -
Because it doesn't exist. David missed the fact that that you are using CRM Online. Your report server lives in the cloud.
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!Monday, June 20, 2011 8:59 PMModerator -
Thanks for the reply Jamie. I spoke to Microsoft Tech Support and here is what I am planning to do finally, based on their suggestion. I will create a web-service to sync the data from the CRM data-server to a local SQL server and then run the reports off the local server and send the mails from the server. Do you think it will work?
- Marked as answer by Jim Glass Jr Wednesday, June 22, 2011 4:47 PM
Tuesday, June 21, 2011 2:53 PM -
Yes that will work. It will involve getting really cozy with the SDK though to set up the sync. Or you could use a third party tool like Scribe.
Link to the SDk. I cover a lot of SDK stuff in my blog too that is linked in my signature.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=420f0f05-c226-4194-b7e1-f23ceaa83b69
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!
- Proposed as answer by Jamie MileyModerator Wednesday, June 22, 2011 2:00 PM
- Marked as answer by Jim Glass Jr Wednesday, June 22, 2011 4:47 PM
Wednesday, June 22, 2011 2:00 PMModerator