{"id":3425,"date":"2016-05-22T03:00:40","date_gmt":"2016-05-21T19:00:40","guid":{"rendered":"http:\/\/www.finereport.com\/en\/?p=3425"},"modified":"2018-09-11T19:30:59","modified_gmt":"2018-09-11T11:30:59","slug":"finereport-linked-data-set","status":"publish","type":"post","link":"https:\/\/frg.fineres.com\/en\/2016\/05\/22\/finereport-linked-data-set\/","title":{"rendered":"FineReport Linked data set"},"content":{"rendered":"<p>We will introduce Linked data set function of FineReport <a title=\"reporting software\" href=\"\/en\/\" target=\"_blank\">reporting software<\/a> in this article.<\/p>\n<h3>1. Problem description<\/h3>\n<p>Scenario I: One template has defined two data sets ds1 and ds2, which fetch from oracle and sqlserver, and you want to know whether the report data analysis are from ds1 or ds2 through parameter control;<\/p>\n<p>Scenario II: There is one piece of template having same styles inside. However, all data are fetched from a database of each subsidiary of final customer. Now, each subsidiary is required to access to its own data;<\/p>\n<p>Scenario III: The data sets ds1 and ds2 are from different data sources with same structures. Now, it is required to combine the data in the table.<\/p>\n<p>The above scenarios can be realized through linked data set. Take Scenario I as an example to describe the usage method of linked data set.<\/p>\n<h3>2. Example<\/h3>\n<p><strong>2.1 Define data set<\/strong><\/p>\n<p>Define data sets ds1 and ds2, which come from databases oracle and sqlserver respectively.<\/p>\n<p><strong>2.2 Use linked data set for combination<\/strong><\/p>\n<p>In the Data Set panel,<span style=\"color: purple;\"> New &gt; Linked Data Set:<\/span><\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/20165205.png\" alt=\"\" \/><\/p>\n<p>At this time, the system will list all available report data sets, server data sets and stored procedures of the report. Click required data set, for example, ds1, ds2;<\/p>\n<p>Add conditions. For example, corresponding condition of ds1 is <span style=\"color: purple;\">$db=&#8221;oracle&#8221;<\/span>, i.e., when the parameter db is oracle, ds1 is used;<\/p>\n<p>Similarly, add conditions for ds2: <span style=\"color: purple;\">$db=&#8221;sqlserver&#8221;<\/span>, i.e., when the parameter db is sqlserver, ds2 is used.<\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/20165206.jpg\" alt=\"\" \/><\/p>\n<p><span style=\"color: red;\">Note: When several data sets meet requirements at the same time, the final result will be the combined result of such data sets. Combining rules are as follows:<\/span><\/p>\n<p><span style=\"color: red;\">To combine several data sets with totally different field names, combine from the first data set from top to down, and match the same field content to one field. If different field names appear, add field name. If there is no data set for this field before combination, use a null as the field value after combination, as shown below:<\/span><\/p>\n<p><img src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/20165207.png\" alt=\"\" \/><\/p>\n<h3>3. Description of version update<\/h3>\n<p>This Linked Data Set Definition interface is the latest version. In V8.0, linked data set is divided into Combine and Select by Conditions,where the first one is compatible, while the latter one not (requiring re-definition).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We will introduce Linked data set function of FineRepor&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[111],"tags":[117],"_links":{"self":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/3425"}],"collection":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/comments?post=3425"}],"version-history":[{"count":1,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/3425\/revisions"}],"predecessor-version":[{"id":3426,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/3425\/revisions\/3426"}],"wp:attachment":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/media?parent=3425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/categories?post=3425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/tags?post=3425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}