如何在CRM 2011图表中格式化日期标签

时间:2013-07-22 17:02:10

标签: xml charts dynamics-crm-2011 customization

我在CRM 2011中有一个堆叠图表,按年份排序。为了检索最近3年的数据,年份存储在日期字段中。

但是,图表中的x轴标签显示为

  • “2011年1月”(2011-01-01)
  • “2012年1月”(2012-01-01)
  • 等等。

除了年份,我真的想剥掉一切。有可能吗?

我试图改变标签格式而没有运气:

<AxisX><LabelStyle Format="yyyy" /></AxisX>

1 个答案:

答案 0 :(得分:3)

虽然我从来没有找到搜索互联网的解决方案,但我突然发现了xml的fetch部分中的一个属性:

  <fetchcollection>
    <fetch mapping="logical" aggregate="true">
      <entity name="ci_customersurveyanswer">
        <attribute groupby="true" alias="_year" dategrouping="month" name="ci_year" />
      </entity>
    </fetch>
  </fetchcollection>

dategrouping是关键所在。将其更改为dategrouping="year"就可以了。