{"id":20270,"date":"2019-08-16T11:36:52","date_gmt":"2019-08-16T11:36:52","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=20270"},"modified":"2019-08-16T11:36:52","modified_gmt":"2019-08-16T11:36:52","slug":"convert-currency-field-value-as-per-logged-in-users-currency-setting-in-ssrs","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/08\/convert-currency-field-value-as-per-logged-in-users-currency-setting-in-ssrs\/","title":{"rendered":"How to Convert Currency Field Value as per logged in user\u2019s Currency setting in SSRS"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p>In this blog, we have explained how to convert currency field value as per the CRM logged-in user currency setting. Thus, it would be helpful for user to get the converted amount in their selected default currency.<\/p>\n<p><strong>For example<\/strong>: User <strong>\u2018A\u2019<\/strong> entered the amount as USD 10 and User <strong>\u2018B\u2019<\/strong> have default currency as <strong>\u2018INR\u2019<\/strong>. In this blog, we have shown how to convert amount USD 10 into selected default currency of user<strong> \u2018B\u2019<\/strong> i.e. INR 665.495<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20271\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/1SSRS.png\" alt=\"SSRS\" width=\"702\" height=\"303\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/1SSRS.png 702w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/1SSRS-300x129.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/1SSRS-660x285.png 660w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><\/p>\n<p>We achieved this by using SSRS, so the user can export the report and check the converted amount in their selected default currency.<\/p>\n<p>FYI, you can achieve this in Script\/Plugin\/Workflow, by implementing the formula given below:<\/p>\n<p><strong><em>((Amount from record \/ Exchange Rate (Currency selected on record)) * Exchange Rate (logged in User Default currency))<\/em><\/strong><\/p>\n<p>Example: ((USD 10\/1.00)* 66.5495000000)) = INR 665.495<\/p>\n<p>Here, in the above example<\/p>\n<ol>\n<li><strong>USD 10<\/strong> is the amount that needs to convert in logged in user currency.<\/li>\n<li><strong>00<\/strong> is the exchange rate of the currency (The currency selected on opportunity record).<\/li>\n<li><strong>015<\/strong> is the Exchange rate of the currency which is selected as the default currency of the user.<\/li>\n<\/ol>\n<blockquote><p>Note: &#8211; The currency is converted based on the exchange rate available in CRM.<\/p><\/blockquote>\n<p><strong>Steps to achieve this in SSRS<\/strong>:<\/p>\n<p><strong>Step 1<\/strong><\/p>\n<p>First, create Data source for report and provide connection details as shown in the below screenshot. Here, we designed report in Dynamics 365 environment with fetch query:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20272\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/2SSRS.png\" alt=\"SSRS\" width=\"725\" height=\"324\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/2SSRS.png 725w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/2SSRS-300x134.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/2SSRS-660x295.png 660w\" sizes=\"(max-width: 725px) 100vw, 725px\" \/><\/p>\n<p><strong>Step 2<\/strong><\/p>\n<p>Now in second step create dataset to get <strong>\u2018Exchange Rate\u2019<\/strong> of Currency which is selected as default currency. Here, we have created dataset named as \u2018<strong>User<\/strong>\u2019 and used the below fetch query to retrieve details:<\/p>\n<p>Fetch used in User dataset:<\/p>\n<p>&lt;fetch version=&#8221;1.0&#8243; output-format=&#8221;xml-platform&#8221; mapping=&#8221;logical&#8221; distinct=&#8221;false&#8221; &gt;<br \/>\n&lt;entity name=&#8221;usersettings&#8221; &gt;<\/p>\n<p>&lt;attribute name=&#8221;currencysymbol&#8221; \/&gt;<\/p>\n<p>&lt;attribute name=&#8221;transactioncurrencyid&#8221; \/&gt;<\/p>\n<p>&lt;filter type=&#8221;and&#8221; &gt;<\/p>\n<p>&lt;condition attribute=&#8221;systemuserid&#8221; operator=&#8221;eq-userid&#8221; \/&gt;<\/p>\n<p>&lt;\/filter&gt;<\/p>\n<p>&lt;link-entity name=&#8221;transactioncurrency&#8221; from=&#8221;transactioncurrencyid&#8221; to=&#8221;transactioncurrencyid&#8221; visible=&#8221;false&#8221; link-type=&#8221;outer&#8221; alias=&#8221;Currency&#8221; &gt;<\/p>\n<p>&lt;attribute name=&#8221;exchangerate&#8221; \/&gt;<\/p>\n<p>&lt;attribute name=&#8221;currencysymbol&#8221; \/&gt;<\/p>\n<p>&lt;\/link-entity&gt;<\/p>\n<p>&lt;\/entity&gt;<\/p>\n<p>&lt;\/fetch&gt;<\/p>\n<p><strong>Step 3<\/strong><\/p>\n<p>Also, create a second dataset to get opportunity record details and exchange rate of currency selected on record. Here, we are showing opportunity details so we have created a new dataset as named \u2018Opportunity\u2019:<\/p>\n<p>Fetch used in Opportunity dataset:<\/p>\n<p>&lt;fetch version=&#8221;1.0&#8243; output-format=&#8221;xml-platform&#8221; mapping=&#8221;logical&#8221; distinct=&#8221;false&#8221;&gt;<\/p>\n<p>&lt;entity name=&#8221;opportunity&#8221;&gt;<\/p>\n<p>&lt;attribute name=&#8221;estimatedvalue&#8221; \/&gt;<\/p>\n<p>&lt;attribute name=&#8221;opportunityid&#8221; \/&gt;<\/p>\n<p>&lt;order attribute=&#8221;name&#8221; descending=&#8221;false&#8221; \/&gt;<\/p>\n<p>&lt;link-entity name=&#8221;transactioncurrency&#8221; from=&#8221;transactioncurrencyid&#8221; to=&#8221;transactioncurrencyid&#8221; visible=&#8221;false&#8221; link-type=&#8221;outer&#8221; alias=&#8221;Currency&#8221;&gt;<\/p>\n<p>&lt;attribute name=&#8221;exchangerate&#8221; \/&gt;<\/p>\n<p>&lt;attribute name=&#8221;currencysymbol&#8221; \/&gt;<\/p>\n<p>&lt;\/link-entity&gt;<\/p>\n<p>&lt;\/entity&gt;<\/p>\n<p>&lt;\/fetch&gt;<\/p>\n<p><strong>Step 4<\/strong><\/p>\n<p>In the next step, enter the below expression in textbox property of table. Please refer below screenshot and expression.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20273\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/3SSRS.png\" alt=\"SSRS\" width=\"758\" height=\"325\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/3SSRS.png 758w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/3SSRS-300x129.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/3SSRS-660x283.png 660w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><\/p>\n<p>=First(Fields!Currency_currencysymbol.Value, &#8220;User&#8221;)+ str((Fields!estimatedvalueValue.Value\/Fields!Currency_exchangerateValue.Value)*First(Fields!Currency_exchangerateValue.Value, &#8220;User&#8221;))<\/p>\n<p><strong>Step 5: <\/strong>Run the report.<\/p>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-20274\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/4SSRS.png\" alt=\"SSRS\" width=\"496\" height=\"145\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/4SSRS.png 496w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/4SSRS-300x88.png 300w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>In this way, using the above solution user can see the amount in the currency of their choice.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-pack\/click-2-clone-microsoft-dynamics-crm-records\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter  wp-image-20277\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/click2clone.png\" alt=\"click2clone\" width=\"812\" height=\"203\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/click2clone.png 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/click2clone-300x75.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/click2clone-768x192.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/08\/click2clone-660x165.png 660w\" sizes=\"(max-width: 812px) 100vw, 812px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog, we have explained how to convert currency field value as per the CRM logged-in user currency setting. Thus, it would be helpful for user to get the converted amount in their selected default currency. For example: User \u2018A\u2019 entered the amount as USD 10 and User \u2018B\u2019 have default currency as\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/08\/convert-currency-field-value-as-per-logged-in-users-currency-setting-in-ssrs\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":20280,"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,45,58],"tags":[1924,1923],"class_list":["post-20270","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-power-bi","category-ssrs-reports","tag-convert-currency-field","tag-ssrs"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/20270","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=20270"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/20270\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/20280"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=20270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=20270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=20270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}