Define date parameters
-
13-06-2021 - |
Вопрос
I'm very new to creating custom reports. I need to prompt a begin date and an end date to the user in the crm, so that the result would be datas only created between those two dates.
I have three parameters to prefilter my datas (account, incident, contract) and added two date parameters in Visual Studio.
But now I'm pretty much stuck...
Any help would be great!
Edit 1: Here is a snippet of my query FETCH Xml-based:
<?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>
The dates are prompted without problem at the execution of the report but the datas are not sorted correctly after I pick them. I've just created two simple date parameters so what am I doing wrong?
Решение
Problem solved !
Simple matter of date format.
After associating a date format expression with my parameters, it works perfectly !
=Format(Parameters!YourDateParameterName.value,"yyyy-MM-dd")