Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 89

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
    89 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.

  • SS-19081439-0 Profile Picture
    on at
    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans