我对创建自定义报告非常陌生。我需要在 crm 中向用户提示开始日期和结束日期,以便结果是仅在这两个日期之间创建的数据。
我使用三个参数来预过滤我的数据(帐户、事件、契约(Contract)),并在 Visual Studio 中添加了两个日期参数。
但现在我几乎陷入困境......
任何帮助都会很棒!
编辑 1:这是我的基于 FETCH Xml 的查询的片段:
<?xml version="1.0"?><fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">
<entity name="incident" enableprefiltering="1">
<attribute name="overriddencreatedon"/>
<attribute name="new_dateclotureincident"/>
<attribute name="title"/><attribute name="createdon"/>
<attribute name="new_travaileffectue"/>
<attribute name="ticketnumber" />
<attribute name="new_dureecumuleeactivites"/>
<order descending="true" attribute="createdon"/>
<filter type="and">
<condition attribute="createdon" value="@Date-Debut" operator="on-or-after"/>
<condition attribute="createdon" value="@Date_Fin" operator="on-or-before"/>
</filter>
<link-entity name="new_contrats" alias="aa" to="new_contrat" from="new_contratsid" enableprefiltering="1">
<attribute name="new_referencecontrat"/>
</link-entity>
<link-entity name="new_lignecontrat" alias="ab" to="new_lignecontrat" from="new_lignecontratid">
<attribute name="new_unitesrestantes"/><attribute name="new_unitesrestantes"/>
</link-entity>
<link-entity name="account" alias="ac" to="customerid" from="accountid" enableprefiltering="1"><attribute name="name"/>
</link-entity></entity></fetch>
在执行报告时,日期提示没有问题,但在我选择数据后,数据排序不正确。我刚刚创建了两个简单的日期参数,那么我做错了什么?
最佳答案
问题解决了!
简单的日期格式问题。
将日期格式表达式与我的参数关联起来后,它完美地工作了!
=Format(Parameters!YourDateParameterName.value,"yyyy-MM-dd")
关于ssrs-2008 - 定义日期参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10914185/