0

我想創建一個custom報告,它將顯示所有/任何Order的所有相關Products。這意味着在訂單頁面顯示所有訂單和相關產品,並且在任何訂單記錄頁面中,它應該只顯示與該訂單相關的產品。使用商業智能開發工作室的自定義報告FetchXML

此前我使用報告嚮導來做這件事,它正在按照我的要求工作。

enter image description here

但我不能夠做到這一點在Business Intelligence Development Studio中。

這是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> 

我怎麼能修改此XML,以便它會像上面?

回答

0

最後,我能夠做到這一點,使用子查詢。

這一點,在子查詢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> 

,這是主要的查詢fetchXML:

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

希望這會幫助別人。

相關問題