{"id":27200,"date":"2021-03-08T11:16:51","date_gmt":"2021-03-08T11:16:51","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=27200"},"modified":"2021-03-08T11:25:23","modified_gmt":"2021-03-08T11:25:23","slug":"ssrs-how-to-get-specific-row-values-from-dataset-of-fetch-xml-based-report-in-dynamics-365-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/03\/ssrs-how-to-get-specific-row-values-from-dataset-of-fetch-xml-based-report-in-dynamics-365-crm\/","title":{"rendered":"SSRS: How to get specific Row values from dataset of Fetch XML based Report in Dynamics 365 CRM"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>In this blog, we have explained how we can get any specific row value in the report, as we know SSRS have inbuilt functions like First, Last. Using these functions, we can get first row details or last row details but what if we need second, third, fourth&#8230; rows value.<\/p>\n<p>Recently, we had a business requirement to show specific row value in the report. Like the need to show the first 3 Order Products from the dataset. Here, I can\u2019t go through the grouping approach as the table contains other information and if we use grouping then the same information will repeat multiple times.<\/p>\n<p>Here, the remaining products are also used in the report, so we can\u2019t exclude them from Dataset.<\/p>\n<p>To handle this scenario, we have gone through the below steps:<\/p>\n<p>Step 1: We have created a new field as \u201cSr. No.\u201d on Order Product and using a plugin we are maintaining its unique sequence (i.e. 1, 2, 3, etc.) number on \u2018order product records\u2019. Here, we can\u2019t populate these unique row numbers at the data set level, because it does not allow to use Row Number(), Aggregate or and other functions. Yes, for SQL-based reports we can handle this sequencing at the reported side. But our report is designed based on the Fetch XML.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-27218 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg\" alt=\"get specific Row values from dataset of Fetch XML based Report\" width=\"945\" height=\"321\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg 945w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report-300x102.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report-768x261.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/1-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report-660x224.jpeg 660w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/p>\n<p>Step 2: Now, we need to add the \u201cSr. No.\u201d field in the report dataset. And using the Lookup function, we can show specific rows values. Please refer below screenshots of the report:<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-27219 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg\" alt=\"get specific Row values from dataset of Fetch XML based Report\" width=\"603\" height=\"323\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg 603w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/2-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report-300x161.jpeg 300w\" sizes=\"(max-width: 603px) 100vw, 603px\" \/><\/a><\/p>\n<p>Step 3: As per the row sequence, we need to map value in <strong>Look up function<\/strong> for each textbox:<\/p>\n<p><strong>1- Display \u2018Product name\u2019 in Row1- textbox1:<\/strong><\/p>\n<p>Lookup(1,Fields!new_srnoValue.Value,Fields!productdescription.Value, &#8220;OpportunityProduct&#8221;)<\/p>\n<p><strong>2- Display \u2018Product name\u2019 in Row2 \u2013 textbox2:<\/strong><\/p>\n<p>Lookup(2,Fields!new_srnoValue.Value,Fields!productdescription.Value, ,&#8221;OpportunityProduct&#8221;)<\/p>\n<p><strong>3- Display \u2018Product name\u2019 in Row3 \u2013 textbox3:<\/strong><\/p>\n<p>Lookup(3,Fields!new_srnoValue.Value,Fields!productdescription.Value, ,&#8221;OpportunityProduct&#8221;)<\/p>\n<p>Using the same way, we have mapped Quantity and Price textboxes values. On the link given below, you can read more on how to use the \u2018look up\u2019 function.<br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/reporting-services\/report-design\/report-builder-functions-lookup-function?view=sql-server-ver15\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/docs.microsoft.com\/en-us\/sql\/reporting-services\/report-design\/report-builder-functions-lookup-function?view=sql-server-ver15<\/a><\/p>\n<p>Step 4: Run the Report and then you can see that the top three rows are showing in the same box:<\/p>\n<h2><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-27220 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg\" alt=\"get specific Row values from dataset of Fetch XML based Report\" width=\"307\" height=\"178\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report.jpeg 307w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/3-get-specific-Row-values-from-dataset-of-Fetch-XML-based-Report-300x174.jpeg 300w\" sizes=\"(max-width: 307px) 100vw, 307px\" \/><\/a><\/h2>\n<p>Conclusion<\/p>\n<p>In this way, using the above steps, we can show nth row values in Report without using grouping.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/user-adoption-monitor-in-dynamics-crm\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-27210 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/user-adoption-monitor.jpg\" alt=\"\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/user-adoption-monitor.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/user-adoption-monitor-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/user-adoption-monitor-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/user-adoption-monitor-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog, we have explained how we can get any specific row value in the report, as we know SSRS have inbuilt functions like First, Last. Using these functions, we can get first row details or last row details but what if we need second, third, fourth&#8230; rows value. Recently, we had a\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/03\/ssrs-how-to-get-specific-row-values-from-dataset-of-fetch-xml-based-report-in-dynamics-365-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"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,19],"tags":[545,592,2198,2197],"class_list":["post-27200","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-crm","tag-dynamics-365-crm","tag-dynamics-crm","tag-fetch-xml-based-report","tag-get-specific-row-values"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/27200","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=27200"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/27200\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=27200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=27200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=27200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}