locked
CRM 2011 on premises: Calling CRM 2011 report in C# code RRS feed

  • Question

  • Hi Guys,

    I have a report which has CRMAF_Filtered aliases.

    I need to call this report in workflow and attach to an email. Most of the references recommending me to call it from SSRS server. in that case there should be "where" clause in my report so that I can pass parameter to run against a specific record.

    I do not think I can call it from CRM in C# code, if I can then how can I call it for one record. As CRMAF_filtered manage itself to call for one record or all.

    Regads,

    Thanks


    Hassan

    Thursday, June 12, 2014 2:11 AM

All replies

  • The easiest option is to create a parameter in the report that you reference in the WHERE clause, and pass this parameter when rendering the report.

    For example, if the report were to run on the account entity, the SQL query would look like this:

    select * from filteredaccount where accountid = @accountid

    And the parameter you pass would have ParameterName = accountid

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Thursday, June 12, 2014 1:18 PM
    Moderator