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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Item not found when trying to retrieve the report from SSRS

(0) ShareShare
ReportReport
Posted on by

Hi,

I am a junior dynamics developer and I am trying to retrieve a report from SSRS in a C# plugin.

I used ReportExecution2005.asmx as a web reference to generate the classes necessary for this task.

I pass the credentials, report path and the server URL through a json using Unsecure Config.

The problem is that I receive the following error:

System.Web.Services.Protocols.SoapException: The item '/reports_crm365/report/testv9_MSCRM/ContactList' cannot be found. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ItemNotFoundException: The item '/reports_crm365/report/testv9_MSCRM/ContactList' cannot be found.

The error occurs when I am trying to load report using the LoadReport method of the ReportExecutionService class.

I am really sure that the report path is correct. My security roles in SSRS are the following: 

Browser, Publisher, Publisher for Microsoft CRM, Report Builder

This is the code of my getReport method, where ReportAttachment is a class where I deserialize the JSON from unsecure config:

public static class ReportTools
    {
        public static byte[] GetReport(ReportAttachment reportInfos)
        {
            byte[] report = null;
            string encoding;
            string mimeType;
            string extension;
            Warning[] warnings = null;
            string[] streamIDs = null;
            string historyId = null;
            string debug = "";
            string reportPath = reportInfos.reportPath;
            string reportServerUrl = reportInfos.reportServer;
            string reportConnectionUser = reportInfos.ssrsUser;
            string password = reportInfos.ssrsPass;
            string reportConnectionDomain = reportInfos.domainName;

            if (string.IsNullOrEmpty(reportServerUrl) || string.IsNullOrEmpty(reportPath)
            || string.IsNullOrEmpty(reportConnectionUser) || string.IsNullOrEmpty(password)
            || string.IsNullOrEmpty(reportConnectionDomain)) return report;

            try
            {
                NetworkCredential credentials = new NetworkCredential(reportConnectionUser, password, reportConnectionDomain);
                ReportExecutionService reportExecutionService = new ReportExecutionService();
                reportExecutionService.PreAuthenticate = true;
                reportExecutionService.Credentials =  credentials;
                reportExecutionService.Url = reportServerUrl;

                ExecutionHeader execHeader = new ExecutionHeader();
                reportExecutionService.ExecutionHeaderValue = execHeader;
                
                ExecutionInfo execInfo = new ExecutionInfo();
                execInfo = reportExecutionService.LoadReport(reportPath, historyId);
                string sessionId = reportExecutionService.ExecutionHeaderValue.ExecutionID;
                
                report = reportExecutionService.Render("PDF",
                    @"False",
                    out extension,
                    out encoding,
                    out mimeType,
                    out warnings,
                    out streamIDs);
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException("THE RAPORT COULD NOT BE RETRIEVED " ex.Message);
            }
            return report;
        }
    }

I have the same question (0)
  • Muhammad Shahzad Shafique Profile Picture
    2,375 Most Valuable Professional on at

    You need to verify if the path is correct and the if credentials used by web service are valid for this report.

  • ASG Profile Picture
    on at

    I also tried with testv9_MSCRM/ContactList as being the report path. The result is the same.

  • ASG Profile Picture
    on at

    My report's data source takes from a 9.0 on premise instance. I logged in on that data source using the user guid as username and organization guid as password.

    I added this code snip to my method before the execution of the LoadReport method:

                   DataSourceCredentials datasetCredential = new DataSourceCredentials();

                   datasetCredential.DataSourceName = "D365OnPremV2";

                   datasetCredential.UserName = "userGuid";

                   datasetCredential.Password = "orgGuid";

                   DataSourceCredentials[] credentials2 = new DataSourceCredentials[1];

                   credentials2[0] = datasetCredential;

                   reportExecutionService.SetExecutionCredentials(credentials2);

    But with no success.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 196 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans