locked
Reports based on the Year RRS feed

  • Question

  • Hello Experts,

    I want to genrate a report which shows all the records created within the selected year. I have used below fetch xml. I'm not getting which condition i have to use to generate report based on the year selected in "Year" parameter. "Year" will be a parameter , which has multiple values. If a user selects any value in Year then report should run taking that Year as condition parameter.

    <?xml version="1.0"?>
    <fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">
    <entity name="new_userconference">
    <attribute name="new_userconferenceid"/> 
    <attribute name="createdon"/> 
    <attribute name="new_lineofbusinessmultiline"/> 
    <attribute name="new_email"/> 
    
    <filter type="and"> 
    <condition attribute="new_attending" value="conference" operator="eq"/> 
    <condition attribute="createdon" operator="on" value="@Year"/>  
    </filter>
    <link-entity name="contact" alias="aa" to="new_contactreference" from="contactid"> 
    <attribute name="parentcustomerid"/> 
    <attribute name="jobtitle"/> 
    <attribute name="fullname"/> 
    <attribute name="emailaddress1"/> 
    <attribute name="telephone1"/> 
    <order descending="false" attribute="fullname"/>
    </link-entity> 
    </entity> 
    </fetch>

    UserConference is custom entity, which is related to contact. I want to show all UserConference records created within the User selected year. For example, Year will be the multiselect parameter which will have values from 2013 to 2030. If User selects 2014 then all records of UserConference created in the year 2014 should be displayed.


    Thanks and Regards. MadhuSudhan M


    • Edited by Madhu-CRM Monday, August 5, 2013 9:33 AM
    Monday, August 5, 2013 9:32 AM

Answers

  • Got the solution. I made 2nd parameter "from" as internal parameter and used

    =CDate("12/31/"&Year(Parameters!from.Label))

    Its working perfectly now.

    Thanks and Regards. MadhuSudhan M

    • Marked as answer by Madhu-CRM Tuesday, August 6, 2013 6:18 AM
    Tuesday, August 6, 2013 6:18 AM

All replies

  • Hi,

    You will need to translate the @Year parameter into a date range of 1st January <Year> to 31st December <Year> as CRM does not have an available operator to allow filters by a specific year.

    I hope this helps.

    Monday, August 5, 2013 10:03 AM
  • Thank you for your reply Roshan

    I'll try as you suggested. Is it possible to generate report just by selecting oone single parameter instead of selecting both from and to ?


    Thanks and Regards. MadhuSudhan M



    • Edited by Madhu-CRM Monday, August 5, 2013 11:18 AM
    Monday, August 5, 2013 11:04 AM
  • Hello Experts,

    As you can see in above picture i have 3 parameters . "from" and "to" parameters has to be loaded based on the selection of parameter "Year". In the above snapshot, i changed the value of parameter Year , but only "from" value got refreshed and changed to 2015 date as required. Whereas "to" parameter still shows its default value and not getting changed to 2015 date. ,even after getting refreshed (in parameter properties i have selected always refresh option).

    Can you help me how to change the value of "to" parameter when "Year" parameter changes.


    Thanks and Regards. MadhuSudhan M

    Tuesday, August 6, 2013 5:38 AM
  • Got the solution. I made 2nd parameter "from" as internal parameter and used

    =CDate("12/31/"&Year(Parameters!from.Label))

    Its working perfectly now.

    Thanks and Regards. MadhuSudhan M

    • Marked as answer by Madhu-CRM Tuesday, August 6, 2013 6:18 AM
    Tuesday, August 6, 2013 6:18 AM