{"id":3553,"date":"2016-06-14T03:00:53","date_gmt":"2016-06-13T19:00:53","guid":{"rendered":"http:\/\/www.finereport.com\/en\/?p=3553"},"modified":"2019-10-24T14:47:49","modified_gmt":"2019-10-24T06:47:49","slug":"parameter-filtering","status":"publish","type":"post","link":"https:\/\/frg.fineres.com\/en\/2016\/06\/14\/parameter-filtering\/","title":{"rendered":"Two Ways of Parameter Filtering."},"content":{"rendered":"<p>Today we will learn about two kinds of parameter filtering of Finereport <a href=\"http:\/\/www.finereport.com\/en\/\" target=\"_blank\"><span style=\"color:blue;\">business intelligence tool<\/span><\/a>. It can be divided into template parameter and data set parameter based on different types of parameters.<\/p>\n<h3>1. Description<\/h3>\n<p>Input parameter value in the parameter query interface control in <a title=\"FineReport BI and reporting tool report designer\" href=\"http:\/\/www.finereport.com\/en\/features\/report-designer\" target=\"_blank\">report designer<\/a>. Click Query button to query corresponding data. This process is called parameter filtering.<\/p>\n<p>Parameter filtering can be divided into <span style=\"color: blue;\">template parameter<\/span> and <span style=\"color: blue;\">data set parameter<\/span> based on different types of parameters.<\/p>\n<h3>2. Filter template parameters<\/h3>\n<p>After the template parameter is bound to the control, there is no association operation about data query. That means, if a direct <span style=\"color: blue;\">page break preview<\/span> is made, the parameter values in control will not be filtered in data query.<\/p>\n<p>At this time, you need to filter the parameters in data column filter conditions of report body.<\/p>\n<p>As shown below, for the imported parameter \u201camount\u201d, the data to be obtained is \u201cTotal Sales Volume &gt; (Parameter value -500)\u201d, you can process parameters via formula:<\/p>\n<p><img class=\"aligncenter\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/201661303.png\" alt=\"\" \/><\/p>\n<p>After operation, preview the template again and you can filter the parameters.<\/p>\n<h3>3. Filter data set parameters<\/h3>\n<p>Different from template parameter, when defining the data set like <span style=\"color: purple;\">SELECT * FROM TableName WHERE ColName = ${para}<\/span>, where ${} content is a variable, i.e., data set parameter, FineReport will form the ${} content into a character string and stitch it to the SQL to form a final executable query after computing, which will be sent to the database end for execution. ${} can directly filter the data.<\/p>\n<p>If it is necessary to add a fixed string for incoming parameter before filtering, the sql can be written as <span style=\"color: purple;\">SELECT * FROM [user password] where password =&#8217;${password+&#8221;123&#8243;}&#8217;<\/span>.<\/p>\n<p>For this reason, no further operation is required after binding the data analysis for data set parameter control, and you can directly preview template and view effect.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we will learn about two kinds of parameter filter&#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\/3553"}],"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=3553"}],"version-history":[{"count":8,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/3553\/revisions"}],"predecessor-version":[{"id":8483,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/3553\/revisions\/8483"}],"wp:attachment":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/media?parent=3553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/categories?post=3553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/tags?post=3553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}