简体   繁体   中英

Custom Report using Business Intelligence Development Studio FetchXML

I want to create a custom report which will display all associated Products of all/any Order . That means in Order page its showing all Orders and associated Products, and in any Order record page it should display only the Products associated with that Order.

Previously I did that using report wizard.It was working as I wanted.

在此处输入图片说明

But I am not able to do it in Business Intelligence Development Studio.

this is the FetchXML

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="salesorderdetail">
    <attribute name="productid" />
    <attribute name="productdescription" />
    <attribute name="priceperunit" />
    <attribute name="quantity" />
    <attribute name="extendedamount" />
    <attribute name="salesorderdetailid" />
    <order attribute="productid" descending="false" />
    <link-entity name="salesorder" from="salesorderid" to="salesorderid" alias="ad">
      <filter type="and">
        <condition attribute="salesorderid" operator="eq">

        </condition>
      </filter>
    </link-entity>
  </entity>
</fetch>

How I can modify this XML so that it will work like above?

Finally, I am able to do it, using sub query.

This it the Sub query fetchXML:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="salesorderdetail">
    <attribute name="productid" />
    <attribute name="productdescription" />
    <attribute name="priceperunit" />
    <attribute name="quantity" />
    <attribute name="extendedamount" />
    <attribute name="salesorderdetailid" />
    <order attribute="productid" descending="false" />
    <link-entity name="salesorder" from="salesorderid" to="salesorderid" alias="af">
      <filter type="and">
        <condition attribute="salesorderid" operator="eq" uitype="salesorder" value="@salesorderid"/>
      </filter>
    </link-entity>
  </entity>
</fetch>

and this is the fetchXML of the main query:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="salesorder" enableprefiltering="1">
    <attribute name="name" />
    <attribute name="salesorderid" />
    <order attribute="name" descending="false" />
    <filter type="and">
      <condition attribute="ownerid" operator="eq-userid" />
      <condition attribute="statecode" operator="in">
        <value>0</value>
        <value>1</value>
      </condition>
    </filter>
  </entity>
</fetch>

Hope this will help someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM