Dynamics CRM 2011创建自定义报告

时间:2012-02-27 14:18:00

标签: xml crm bids microsoft-dynamics

我正在尝试使用BIDS创建一些自定义报告。我的概念证明是使用报价实体。

我使用以下FetchXML创建了一个子报告:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="quotedetail">
<attribute name="productid" />
<attribute name="productdescription" />
<attribute name="priceperunit" />
<attribute name="quantity" />
<attribute name="extendedamount" />
<attribute name="quotedetailid" />
<attribute name="isproductoverridden" />
<order attribute="productid" descending="false" />
<link-entity name="quote" from="quoteid" to="quoteid" alias="aa">
<filter type="and">
<condition attribute="quotenumber" operator="eq" value="@quoteid" />
</filter>
</link-entity>
</entity>
</fetch>

当在运行时提供quoteid参数时,这是有效的。 然后,我使用以下FetchXML创建主报告:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="quote" enableprefiltering="1" prefilterparametername="CRM_FilteredQuote">
<attribute name="name" />
<attribute name="totalamount" />
<attribute name="quoteid" />
<order attribute="name" descending="false" />
</entity>
</fetch>

我收到报价ID的提示,当我输入时,我收到以下错误:

  

本地报告处理期间发生错误。   报告处理期间发生错误。   无法读取数据集DataSet1的下一个数据行。   传递给平台的XML不是格式良好的XML。   XML无效。

我已经阅读了大量的博客和文章,并尝试了许多与过滤器和预过滤器的变化,但我不能再进一步了。希望有人可以看到我的错误,并指出我正确的方向。

1 个答案:

答案 0 :(得分:2)

在您的子报告中 - 尝试更改此行:

<condition attribute="quotenumber" operator="eq" value="@quoteid" />

为:

<condition attribute="quoteid" operator="eq" value="@quoteid" />

它正在寻找报价编号而不是唯一报价标识符作为键值。