0
votes

I am trying to add a simple subreport to a report in Reporting Services using Dynamics CRM (FetchXML). This is all on my local machine, neither report has been published yet. I am only trying to get them to run in Reporting Services. I added a Parameter to the subreport for the field "name". I then added a subreport to the main report. I then selected the subreport via subreport properties and passed the parameter here as well.

Here is the FetchXML from the Main Report

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="account">
    <attribute name="name" />
    <attribute name="ownerid" />
    <attribute name="new_databaseserver" />
    <attribute name="new_databasename" />
    <attribute name="accountid" />
    <order attribute="name" descending="false" />
  </entity>
</fetch>

Here is the FetchXML from the subreport

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="account">
    <attribute name="name" />
    <attribute name="accountid" />
    <attribute name="new_adam" />
    <order attribute="name" descending="false" />
  </entity>
</fetch>

Here is the error:

[rsErrorExecutingSubreport] An error occurred while executing the subreport 'SubReport1' (Instance: 19iT0R0x0S0): Data retrieval failed for the subreport, 'SubReport1', located at: /SubReport1. Please check the log files for more information.

I've been racking my brain over this all weekend. Any help would be really appreciated.

1
Did you check the log files for more information? - Mark Thomas
I don't have access to them at home but I will tomorrow. Do you see any issue with what I've pasted here so far? Is it possible to use subreports in Dynamics CRM? - SusieQ

1 Answers

0
votes

I noticed you don't have the filter expression in subreport. I think reporting services tries to get all accounts data from CRM two times: for 1st report and then for subreport. Try use this fetch for subreport:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="account">
    <attribute name="name" />
    <attribute name="accountid" />
    <attribute name="new_adam" />
    <order attribute="name" descending="false" />
    <filter type="and">
       <condition attribute="name" operator="eq" value="@Name" />
    </filter>
  </entity>
</fetch>

The @Name is name of your parameter.