Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Run .rdl report while supplying custom data from plugin, or return a PDF download directly from plugin

Posted on by 87

My situation:  (I use CRM 2016 v9 on premise)

I pull data down from a 3rd party accounting system via their webservice.  I then use this data to run a report from our SSRS server.  I currently do this via a .NET windows service and it saves the files to a folder.

Now my goal is to do this on demand within CRM from the Account form.

What I am pretty sure I can do, is get the data, generate the PDF from the SSRS server and save the PDF to an Email or Note on the account.  But this is not optimal.

I'd like the user to be able to click a ribbon button that fires a plugin, pulls down the 'data' used to generate the report and then have the actual report pop up in a window on their screen.  From there they can either just view it or save as PDF.

I know how to run a report from CRM from Javascript, and pass a custom parameter in the URL, but in this situation the data i need to pass to the report can be 1000's of characters long.

Can I do one of these options:

1.  Within my plugin, get the data from 3rd party, return the data from my plugin, and run the report from Javascript .rdl file added to CRM, but pass in a large data parameter?  how?

2.  Within my plugin, get the data from 3rd party, generate the PDF report from SSRS server, return PDF directly to user?  how?

3. I just thought of this. Within my plugin, get the data from 3rd party, save data to a field on Account, return to user, run report with custom parameter sending in just accountid, which will be used to pull the newly saved data into the report?  ...I may have just figured out the best approach here..

4. I am reading about "Microsoft Dynamics 365 Fetch" as a datasource.  I don't have that option in my Reporting project so I must be missing something there.

Thoughts on best approach?  Is 1 or 2 even possible?  If not I will rule them out.

Thanks!

Coty

  • Coty Profile Picture
    Coty 87 on at
    RE: Run .rdl report while supplying custom data from plugin, or return a PDF download directly from plugin

    Thanks for the info Shyam on how to get the fetch XML option within VS.

    I wanted to post my solution here so I could close this out.  This is what I did:

    1.  Added 2 fields on the Account entity, 1 for a date and the other for data returned from 3rd party service.

    2.  Use ribbonworkbench to create a custom button that launches an html webresource window.

    3.  The html webresource checks the age of the data, and depending on the age runs the report on the stored data or executes a plugin.

    4.  The plugin accesses the 3rd party API to get the data, models it into an object, converts to XML and saves to the database.

    5.  The plugin returns a simple string response back to the html webresource with either nothing or an error if something goes wrong.

    6.  html webresource runs the CRM report.

    7.  The CRM report was created with an XML datasource that gets loaded via a query fed parameter.

    All in all it's working really well.

  • RE: Run .rdl report while supplying custom data from plugin, or return a PDF download directly from plugin

    Hello,

    You need to install the Report authoring extension to see the Fetch option. Check this article docs.microsoft.com/.../report-writing-environment-using-sql-server-data-tools

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans