web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to run report in workflow in CRM 2011 online

(0) ShareShare
ReportReport
Posted on by 200

Hello,

I would like to do the following:

-          I am writing a custom workflow activity in c# for CRM 2011 Online.

-          In workflow process I am creating e-mail messages, running custom workflow activity

-          I would like to add an attachment. The attachment should be a pdf file: the output of a CRM report.

-          The question is: how can I run a report within the workflow activity and get the result as a pdf to be able to attach it to an e-mail. The main point is that it should work in CRM Online.

Many thx.

Stan

*This post is locked for comments

I have the same question (0)
  • Danish Profile Picture
    350 on at

    Hi Stan,

    Accordingly "However, one area of challenge for Microsoft CRM Online is custom reporting.  Some background on this.  Unlike Microsoft CRM On-Premise, Microsoft CRM Online does not support uploading of SQL Report Services (SRS) custom reports or accessing the SQL Server Database filtered views.  CRM Online does not allow users to directly access the CRM Application Server or Database Server - this is a good thing to maintain security and the 99.9% uptime for all the companies that is running on Microsoft CRM Online.  In fact, I'm not aware of any other major On-Demand Business Application vendors allowing their users to directly accessing the application or database server. " - as per this post (CRM Online Reporting Options - community.dynamics.com/.../crm-online-58-reporting-options.aspx)

    By using Microsoft Dynamics CRM SDK, you can easily achieve the desired results. Here is an old article which does the same but using older version, I am sure the newer version of SDK will also work the same way.

    Article link: a33ik.blogspot.ae/.../custom-workflow-action-which-renders.html

    SDK link: msdn.microsoft.com/.../bb928212.aspx

    Best,

    -Danish.

  • Stef Rose Profile Picture
    240 on at

    I would recommand you first to look up for restricted rights when modifing CRM online databases and when writing exclusively your entity (custom_workflow) in C# only. The idea is that CRM deployment is, at first, a member of .NET FrameWork and, at second, a member of C++ library that coming at first plan with CRM deployment. Plus, you may consider that a great part of this library is compiled thru CRM databases composition and the other part is the ASP.NET library, also compiled as a prioritive member in .NET Framework hierarchy. And finally, the code lines from that two libraries are translate in *mechanical langage* thru the RunTime_Library. You may telling me that is hard of understanding or it has no importance of knowing the Microsoft .NET Library structure, but if you build your MS CRM "add in" in C#, you will be confronted to system failures when trying to incorporate your entity to CRM_databases and you could harm your entire business system. You should have in CRM online deployment the genarating_reports functional and the mailing_system operative. The next step is only using a pdf writer and recording your reports in pdf format if you account_rights authorized you to write or to modify such type of files.

  • Verified answer
    Crm Dynamics Profile Picture
    200 on at

    Hello,

    thx Stephane and Danish for your comments.

    i've finally managed to resolve this problem without using workflow.

    1. On form is defined hidden web resource (xrmmatrix.blogspot.sk/.../creating-report-as-pdf-attachment-in.html). Web resource contains logic to create report as pdf attachment into Notification. I've only changed web resource code to generate Email entity and add into this email pdf report as attachment.

    2. I am also using custom ribbon button with javascript to call method in web resource:

    document.getElementById("<web resource name>").contentWindow.<function name>;

    example: document.getElementById("WebResource_generateReportCase").contentWindow.createAttachment();

    When you will use web resource code from "xrmmatrix page" to generate report pdf, result will not be context sensitive (it means if you have report rdl defined with pre-filtering, you will not get only one record in report, but still all records) --> to resolve this issue is best to make report itself executable from entity (click edit on selected Report /General/Categorization/Display In = Forms for related record types;...); then open record form and by pressing F12 run 'Developer Tools'/tab Network/click 'Start capturing'; then go back to form and run report (button Run Report/<your report name>); go back to Developer Tools and you will see many URLs where you have to find this url "‘/CRMReports/rsviewer/reportviewer.aspx’" [Method = POST] and open it by double click and in tab "Request body" you will find link which is used to run reports => this link you can use in your webresource to have context sensitive reports...

    Good luck.

    Stan

  • Community Member Profile Picture
    on at

    Hello I need help. I have crm on line and my report have enableprefiltering (quoteid) in this moment Ineed the solution of xmtarix but I cant resolve it yet.

    I have the ribbon button but it's not work. can you helpme? i have the same code of xmatrix and i have the report publish this have enableprefiltering. I dont understand well the part of f12 del IE developer tools

    Can you explainme step by step o sendme the link and where i can put this link in my code JS.

    Thanks a lot

  • Community Member Profile Picture
    on at

    the ribbon button call funtion createattachment but it doesnt convert my report to pdf and it doesn work.

    Thanks for your help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans