{"id":12678,"date":"2018-08-17T17:40:28","date_gmt":"2018-08-17T12:10:28","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=12678"},"modified":"2018-08-17T17:40:28","modified_gmt":"2018-08-17T12:10:28","slug":"get-specific-filter-parameter-value-in-ssrs-report-dynamics-365-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2018\/08\/get-specific-filter-parameter-value-in-ssrs-report-dynamics-365-crm\/","title":{"rendered":"Get Specific Filter Parameter Value in SSRS Report \u2013 Dynamics 365 CRM"},"content":{"rendered":"<p style=\"text-align: justify;\">Recently, we had a business requirement in which one of our clients needed some modifications in report. So as we all know, SSRS reporting tool is most widely used to make customizations in the report.<\/p>\n<h2 style=\"text-align: justify;\"><strong>Requirement: <\/strong><\/h2>\n<p style=\"text-align: justify;\">User should be able to see the updated report header based on, the value selected for the field in filter criteria of report. For e.g.<\/p>\n<p style=\"text-align: justify;\">Suppose, there are multiple opportunity records in Dynamics 365 and each of the opportunity record contains \u201cLost \/Open\/Won\u201d options in \u201c<strong>Status<\/strong>\u201d field. And there is a custom report created which shows the opportunities created with \u201cLost \/Open\/Won\u201d status in last 7 days.<\/p>\n<p style=\"text-align: justify;\">Now user usually run the report and in report header, it shows \u201c<strong><em>Lost &#8211; Opportunities created in last 7 days<\/em><\/strong>\u201d which was a static label.<\/p>\n<p style=\"text-align: justify;\">And client requirement is when the user made modification in filter criteria and run report at that time user should be able to see the dynamic label.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter  wp-image-12679\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/08\/1Get-Specific-Filter-Parameter-Value-in-SSRS-Report.png\" alt=\"Get Specific Filter Parameter Value in SSRS Report\" width=\"972\" height=\"329\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter  wp-image-12680\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/08\/2Get-Specific-Filter-Parameter-Value-in-SSRS-Report.png\" alt=\"Get Specific Filter Parameter Value in SSRS Report\" width=\"967\" height=\"279\" \/><\/p>\n<h2><strong>For e.g. <\/strong><\/h2>\n<p>If the user selects Status = \u201c<strong>Won<\/strong>\u201d in filter criteria and Run Report.<\/p>\n<p>Then in the report, the header needs to be changed to \u201cWon &#8211; Opportunities created in last 7 days\u201d i.e. dynamics report header.<\/p>\n<h2><strong>Solution:<\/strong><\/h2>\n<p>To achieve this we have made following changes in expression of header text box:<\/p>\n<ul>\n<li>We created a parameter which is generally used to get the filter value in report i.e. \u201c<strong><em>CRM_FilterText<\/em><\/strong>\u201d.<\/li>\n<li>Once we get the filter value in report parameter as a string we would need to divide this parameter and to get Status value.<\/li>\n<\/ul>\n<h2>So we have used the following code in the expression:<\/h2>\n<pre class=\"lang:default decode:true\">=Replace(Split(Mid(Parameters!CRM_Fi\nlterText.Value.ToString().Trim,(InStrRev(Parameters!CRM_FilterText.Value.ToString().Trim(),\"Status\n \u201c)),Parameters!CRM_FilterText.Value.ToString().Trim().Length),\" \").GetValue(2),\";\",\", \") + \" - \nOpportunities created in last 7 days\"<\/pre>\n<blockquote><p><strong><em>Note: Here we have used the \u201cCRM_FilterText\u201d OOB parameter to get the filter criteria in report.<\/em><\/strong><\/p><\/blockquote>\n<p style=\"text-align: left;\"><img decoding=\"async\" class=\"aligncenter  wp-image-12681\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/08\/3Get-Specific-Filter-Parameter-Value-in-SSRS-Report.png\" alt=\"Get Specific Filter Parameter Value in SSRS Report\" width=\"973\" height=\"296\" \/><\/p>\n<p>By using the above expression in header text we can set dynamics status for the report.<\/p>\n<blockquote><p><strong><em>Note: This code will only work for status options without spaces.<\/em><\/strong><\/p><\/blockquote>\n<h2><strong>Conclusion:<\/strong><\/h2>\n<p>We can get the specific text used in filter criteria to filter report and set it in the report as text in Dynamics 365 CRM.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-pack\/click-2-export-microsoft-dynamics-crm-reports\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter  wp-image-10864\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2017\/12\/Click2Export-banner.png\" alt=\"Export Dynamics CRM Reports\" width=\"974\" height=\"244\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, we had a business requirement in which one of our clients needed some modifications in report. So as we all know, SSRS reporting tool is most widely used to make customizations in the report. Requirement: User should be able to see the updated report header based on, the value selected for the field in\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2018\/08\/get-specific-filter-parameter-value-in-ssrs-report-dynamics-365-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":12682,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,18,19,58],"tags":[581,695,1664],"class_list":["post-12678","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-ssrs-reports","tag-dynamics-365-ssrs-report","tag-dynamics-crm-ssrs-report","tag-ssrs-report"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/12678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=12678"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/12678\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/12682"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=12678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=12678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=12678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}