2012-11-12 106 views
1

如何將xml圖表中另一個實體的屬性分組? 我想通過CRM用戶(x軸)的約會號碼(y軸),約會按帳戶的accountcategorycode分組。 我正在使用僅顯示有關帳戶約會的視圖。如何在Dynamics CRM中按照相關實體的屬性進行分組?

我有一個圖表組約會的賬戶,效果很好:(你似乎已經完成)

<visualization> 
     <visualizationid>{8CC67476-302B-E211-86B2-005056BD0001}</visualizationid> 
     <name>Appointment by User Stacked by Rating</name> 
     <primaryentitytypecode>appointment</primaryentitytypecode> 
     <datadescription> 
     <datadefinition> 
      <fetchcollection> 
      <fetch mapping="logical" aggregate="true"> 
       <entity name="appointment"> 
       <attribute groupby="true" alias="ownerid" name="ownerid" /> 
       <attribute groupby="true" alias="gp" name="regardingobjectid" /> 
       <attribute alias="accountref" name="regardingobjectid"   aggregate="count" /> 
       <link-entity name="account" from="accountid" to="regardingobjectid" alias="aa"> 
        <attribute name="accountcategorycode" alias="code" aggregate="count" /> 
       </link-entity> 
       <filter type="and"> 
        <condition attribute="activitytypecode" operator="eq" value="4201" /> 
       </filter> 
       </entity> 
      </fetch> 
      </fetchcollection> 
      <categorycollection> 
      <category alias="ownerid"> 
       <measurecollection> 
       <measure alias="accountref" /> 
       </measurecollection> 
      </category> 
      </categorycollection> 
     </datadefinition> 
     </datadescription> 
     <presentationdescription> 
     <Chart Palette="None" PaletteCustomColors="55,118,193; 197,56,52; 149,189,66; 117,82,160; 49,171,204; 255,136,35; 97,142,206; 209,98,96; 168,203,104; 142,116,178; 93,186,215; 255,155,83"> 
      <Series> 
      <Series ChartType="StackedColumn" IsValueShownAsLabel="False" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series> 
      </Series> 
      <ChartAreas> 
      <ChartArea BorderColor="White" BorderDashStyle="Solid"> 
       <AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount"> 
       <MajorGrid LineColor="239, 242, 246" /> 
       <MajorTickMark LineColor="165, 172, 181" /> 
       <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" /> 
       </AxisY> 
       <AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount"> 
       <MajorTickMark LineColor="165, 172, 181" /> 
       <MajorGrid LineColor="Transparent" /> 
       <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" /> 
       </AxisX> 
      </ChartArea> 
      </ChartAreas> 
      <Titles> 
      <Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="59, 59, 59"></Title> 
      </Titles> 
     </Chart> 
     </presentationdescription> 
     <isdefault>false</isdefault> 
    </visualization></visualization> 

回答

0

您是否嘗試導出表,並通過修改fetchXML與鏈接組?我經常在彙總語法中的fetchXML幫助頁面上引用示例:http://msdn.microsoft.com/en-us/library/gg309565.aspx#groupby_linked

請注意鏈接跳轉到的示例爲groupby_linked,並按您的預期工作。 (將groupby移動到您的鏈接實體的字段中)

FetchXML可能不允許多個group-by的跨實體,請嘗試一下,如果是這種情況,您會很快發現它。

相關問題