{"id":3571,"date":"2016-06-17T03:00:22","date_gmt":"2016-06-16T19:00:22","guid":{"rendered":"http:\/\/www.finereport.com\/en\/?p=3571"},"modified":"2019-10-24T14:47:56","modified_gmt":"2019-10-24T06:47:56","slug":"bind-parameter-control-to-data","status":"publish","type":"post","link":"https:\/\/frg.fineres.com\/en\/2016\/06\/17\/bind-parameter-control-to-data\/","title":{"rendered":"How to Bind Parameter Control to Data."},"content":{"rendered":"<p>We will introduce Bind Parameter Control to Data in this article.In order to facilitate parameter query data function, FineReport provides a specific parameter interface to place and query related controls in our <a title=\"FineReport BI and reporting tool report designer\" href=\"http:\/\/www.finereport.com\/en\/features\/report-designer\" target=\"_blank\">report designer<\/a>.<\/p>\n<h3>1. Description<\/h3>\n<p>To facilitate parameter query data function, FineReport <a href=\"http:\/\/www.finereport.com\/en\/\" target=\"_blank\"><span style=\"color:blue;\">business intelligence tool<\/span><\/a> provides a specific parameter interface to place and query related controls.<\/p>\n<h3>2. Example<\/h3>\n<p>Based on the figure below, we will create a simple Query Interface to understand how to create a parameter query interface.<\/p>\n<p><strong>2.1 Open report<\/strong><\/p>\n<p>Open report.This template is the sample template in <span style=\"color: blue;\">Template Parameter<\/span> section, where a parameter interface is added. Now, we will take this template as an example to introduce how to use parameter interface.<\/p>\n<p><strong>2.2 Parameter layout<\/strong><\/p>\n<p>As shown below, drag the control to corresponding position, as shown below:<\/p>\n<p><img class=\"aligncenter\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/201661412.png\" alt=\"\" \/><\/p>\n<p><span style=\"color: red;\">In addition: The parameter interface adopts Absolute Layout. Therefore, you can drag the control to any position on the panel.<\/span><\/p>\n<p><strong>2.3 Editing style of parameter control<\/strong><\/p>\n<p>All default parameter controls are text boxes. Sometimes, if you want to select date with Date control or directly select data via a drop-down box, you need to define the editing style of parameter control.<\/p>\n<p>For example, set the area control as a drop-down box. Select Area control and the Wrench in the control. Select Control Type in the dialog below as a drop-down box:<\/p>\n<p><img class=\"aligncenter\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/201661413.png\" alt=\"\" \/><\/p>\n<p><span style=\"color: red;\">Note: To change a selected control type, you need to delete the original control and drag the required control type from the Control List to the Parameter Interface. Then, change the control name as the parameter name.<\/span><\/p>\n<p>In <span style=\"color: purple;\">Basic Attributes &gt; Data Dictionary<\/span> of Attribute table, set the drop-down box data as shown below:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/201661414.png\" alt=\"\" width=\"666\" height=\"400\" \/><\/p>\n<p><span style=\"color: red;\">Note: Set Data Dictionary for control means to bind an option value for the control. In general, it is applicable to controls where values can be directly selected, like drop-down box, drop-down tree, etc.<\/span><\/p>\n<p><span style=\"color: red;\">In addition: If the control is bound to the data set parameter, as the default value of data set parameter cannot be directly transferred to the parameter panel control, you need to additionally set the control default value. For details, refer to <span style=\"color: blue;\">Control Default Value<\/span>. However, the default value of <span style=\"color: blue;\">Template Parameter<\/span> can be directly transferred to the control default value, requiring no additional setting.<\/span><\/p>\n<p><strong>2.4 Control name<\/strong><\/p>\n<p>Parameter and control are bound via control name. That means, the control name is consistent with the parameter name. If the parameter control is generated by clicking the Parameters Below Not Generated button at the right bottom, the control name will be automatically bound to the parameter. If the parameter control is dragged, you need to change the control name in the Control Name Attribute to make it consistent with the parameter name.<\/p>\n<p><strong>2.5 Save and preview report<\/strong><\/p>\n<p>Save report and view the effect via Page Break Preview.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We will introduce Bind Parameter Control to Data in thi&#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\/3571"}],"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=3571"}],"version-history":[{"count":7,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/3571\/revisions"}],"predecessor-version":[{"id":8487,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/3571\/revisions\/8487"}],"wp:attachment":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/media?parent=3571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/categories?post=3571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/tags?post=3571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}