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)

Printing SSRS report in various context using Fetch-XML

(0) ShareShare
ReportReport
Posted on by

Hi guys,

I am in desperate need of someone's help. I need to make my report context-sensitive so it is able to run on different opportunities. I have 4 seperate DataSets. The report will be run Opportunities. Currently I have it so it runs just on 1 opportunity. I need it so when I run it on 10 seperate opportunities, the report is generated 10 times seperately. I am sharing the Fetch-XML for my Datasets. DataSet 2, DataSet 3 and DataSet 4 have the same Fetch XML, except the filtering condition is different. This is going to run on Opportunities and print out report about various different types of products on the report. Please help me out guys. This is the worst I have seen so far.

Thanks

DataSet1 - Main Dataset

<fetch mapping="logical" output-format="xml-platform" version="1.0" distinct="false">
  <entity name="opportunity" enableprefiltering="1" prefilterparameter="CRM_opportunity">
    <attribute name="opportunityid" />
    <attribute name="name" />
    <attribute name="ownerid" />
    <attribute name="xrm_promotions" />
    <attribute name="xrm_material" />
     <attribute name="xrm_instllationcharges" />
     <attribute name="xrm_totalcontract" />
    <order descending="false" attribute="name" />
    <attribute name="xrm_existingcontract" />
    <link-entity name="account" to="parentaccountid" from="accountid" alias="accountid" link-type="outer" visible="false">
<attribute name="telephone1" />
      <attribute name="address2_postalcode" />
      <attribute name="address2_line2" />
      <attribute name="address2_line1" />
      <attribute name="address2_city" />
      <attribute name="address1_postalcode" />
      <attribute name="address1_line2" />
      <attribute name="address1_line1" />
      <attribute name="address1_city" />
       <attribute name="address1_country" />
      <attribute name="name" />
    </link-entity>
    <link-entity name="contact" to="parentcontactid" from="contactid" alias="contactid" link-type="outer" visible="false">
      <attribute name="jobtitle" />
      <attribute name="fullname" />
      <attribute name="emailaddress1" />
    </link-entity>
  </entity>
</fetch>

DataSet 2, DataSet 3 and DataSet 4.

<fetch mapping="logical" output-format="xml-platform" version="1.0" distinct="false" >
  <entity name="xrm_servicelevelproduct" enableprefiltering="1" prefilterparameter="CRM_opportunity">
    <attribute name="xrm_upload" />
    <attribute name="xrm_frenchname" />
    <attribute name="xrm_download" />
    <attribute name="xrm_bandwidth" />
    <attribute name="xrm_chargeperiodicity" />
    <order descending="false" attribute="xrm_bandwidth" />
    <filter type="and" >
      <condition value="163650000" attribute="xrm_servicetype" operator="eq" />
    </filter>
    <link-entity name="xrm_subscriptionproduct" to="xrm_servicelevelproductid" from="xrm_product" alias="SubscriptionProduct" link-type="outer" >
      <attribute name="xrm_rentbuyoption" />
      <attribute name="xrm_amount" />
      <order descending="false" attribute="xrm_rentbuyoption" />
      <link-entity name="xrm_subscription" to="xrm_subscription" from="xrm_subscriptionid" alias="Subscription" >
        <attribute name="xrm_name" />
        <attribute name="createdon" />
        <attribute name="xrm_amountrecurringcharges" />
        <order descending="false" attribute="xrm_name" />
        <link-entity name="opportunity" to="xrm_opportunity" from="opportunityid" alias="Opportunity" link-type="outer" visible="false" >
    <attribute name="opportunityid" />          
<attribute name="xrm_terminmonths" />
          <attribute name="xrm_installationdate" />
        </link-entity>
        <link-entity name="account" to="xrm_account" from="accountid" alias="account" link-type="outer" visible="false">
          <attribute name="address1_line1" />
          <attribute name="address1_postalcode" />
          <attribute name="address1_country" />
          <attribute name="address1_city" />
	<attribute name="address1_stateorprovince" />
        </link-entity>
      </link-entity>
    </link-entity>
  </entity>
</fetch>


*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I had similar task in the past. Answer - you should look how to use repeaters and subreports. As an example you can look Standard Quote/Quote SubReport reports.

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