{"id":2009,"date":"2010-07-06T16:11:43","date_gmt":"2010-07-06T08:11:43","guid":{"rendered":"http:\/\/www.finereport.com\/CN\/wordpress\/knowledge\/write\/%e7%94%a8finereport%e6%8a%a5%e8%a1%a8%e5%b7%a5%e5%85%b7%e5%88%b6%e4%bd%9c%e4%b8%bb%e5%ad%90%e5%a1%ab%e6%8a%a5%e8%a1%a8.html"},"modified":"2020-08-31T09:09:12","modified_gmt":"2020-08-31T01:09:12","slug":"super-sub","status":"publish","type":"post","link":"https:\/\/frg.fineres.com\/en\/2010\/07\/06\/super-sub\/","title":{"rendered":"Use FineReport making main report and subreport"},"content":{"rendered":"<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub1.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub1.jpg\" alt=\"main report and subreport\" width=\"442\" height=\"199\" \/><\/a><\/p>\n<p>As shown in the figure is a fill tables, divided into two parts, the upper part of the main table for the order, the lower half is divided into order details, some of the data were from two different physical form, after the user modifies the data, while preserving to two physical table and maintain a database transaction consistency.<\/p>\n<p><strong>Here we look at the process of achieving the above statements with FineReport <a title=\"reporting tools\" href=\"https:\/\/www.finereport.com\/en\/\">reporting tool<\/a><\/strong>.<\/p>\n<p><!--more--><\/p>\n<p><strong>1.frDemo Connect to the database<\/strong><strong><em>frDemo<\/em><\/strong><\/p>\n<p><strong>2.Design Reports<\/strong><\/p>\n<p>2.1 New Report<\/p>\n<p>2.2 template design<br \/>\nThe basic framework of the following diagram design good report.<\/p>\n<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub2.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub2.jpg\" alt=\"template design \" width=\"470\" height=\"218\" \/><\/a><\/p>\n<p>2.3 Create a data set<\/p>\n<p>New Dataset ds1:<br \/>\n<strong>SQL statement:<\/strong><strong><em>select * from <\/em><\/strong>Order Details<\/p>\n<p>New Database ds2:<br \/>\n<strong>SQL statement<\/strong><strong><em>select * from <\/em><\/strong> order <strong><em>where<\/em><\/strong> order ID=10248<\/p>\n<p>2.4 Binding Data Columns<\/p>\n<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub3.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub3.jpg\" alt=\" Binding Data Columns\" width=\"467\" height=\"217\" \/><\/a><\/p>\n<p>Follow these forms will be dragged into the field data sets corresponding statements within the cell, and make the appropriate settings.<\/p>\n<table class=\"centered\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"64\">Bidding Data Column<\/td>\n<td valign=\"top\" width=\"132\">Content<\/td>\n<td valign=\"top\" width=\"243\">Basic property Setting<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">B3<\/td>\n<td valign=\"top\" width=\"132\">ds2.order ID<\/td>\n<td valign=\"top\" width=\"243\"><strong>from top to bottom <\/strong> extension, the rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">D3<\/td>\n<td valign=\"top\" width=\"132\">ds2.Ship date<\/td>\n<td valign=\"top\" width=\"243\"><strong>extended from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">F3<\/td>\n<td valign=\"top\" width=\"132\">ds2.Arrival date<\/td>\n<td valign=\"top\" width=\"243\"><strong>extended from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">B4<\/td>\n<td valign=\"top\" width=\"132\">ds2.Customer ID<\/td>\n<td valign=\"top\" width=\"243\"><strong>extended from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">F4<\/td>\n<td valign=\"top\" width=\"132\">ds2. ShipName<\/td>\n<td valign=\"top\" width=\"243\"><strong>extend from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">B5<\/td>\n<td valign=\"top\" width=\"132\">ds2.Shippers<\/td>\n<td valign=\"top\" width=\"243\"><strong>extend from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">D5<\/td>\n<td valign=\"top\" width=\"132\">ds2.Freight<\/td>\n<td valign=\"top\" width=\"243\"><strong>extend from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">F5<\/td>\n<td valign=\"top\" width=\"132\">ds2.Consignors city<\/td>\n<td valign=\"top\" width=\"243\"><strong>extend from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">A8<\/td>\n<td valign=\"top\" width=\"132\">=&amp;B8<\/td>\n<td valign=\"top\" width=\"243\"><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">B8<\/td>\n<td valign=\"top\" width=\"132\">ds1.Product ID<\/td>\n<td valign=\"top\" width=\"243\"><strong>extend from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">C8<\/td>\n<td valign=\"top\" width=\"132\">ds1.Price<\/td>\n<td valign=\"top\" width=\"243\"><strong>extend from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">D8<\/td>\n<td valign=\"top\" width=\"132\">ds1.Discounts<\/td>\n<td valign=\"top\" width=\"243\"><strong>extend from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">E8<\/td>\n<td valign=\"top\" width=\"132\">ds1.Quantity<\/td>\n<td valign=\"top\" width=\"243\"><strong>extend from top to bottom<\/strong>\uff0cthe rest of the default<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"64\">F8<\/td>\n<td valign=\"top\" width=\"132\">=C8*E8<\/td>\n<td valign=\"top\" width=\"243\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2.5 Cell set filters<br \/>\nDouble-click the B8, enter the cell data Columns dialog box, click on the filter, set the filter conditions: Order ID equal to B3.<\/p>\n<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub4.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub4.jpg\" alt=\"Cell filtering\" width=\"554\" height=\"396\" \/><\/a><\/p>\n<p>2.6 Setting form properties of the cell<br \/>\nOn B3, D3, F3, B4, F4, B5, D5, F5, A8, B8, C8, D8, E8, F8 cell setting form properties, including D3, F3 is the date type, C8, D8, E8 are digital type, and allows decimals, the rest are text type.<\/p>\n<p>2.7 Furnished property is set to report<br \/>\nOpen Report | Report Properties dialog box to fill, as shown:<\/p>\n<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub6.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub6.jpg\" alt=\"Report Properties\" width=\"557\" height=\"427\" \/><\/a><\/p>\n<p>Click the Add button in the upper left corner to add a new built-in SQL. \u3002<\/p>\n<p>Database selection <strong>frDemo<\/strong>\uff0cmode selection order is empty\uff0cselect table <strong>order<\/strong>\uff0cas shown:<\/p>\n<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub7.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub7.jpg\" alt=\"add built-in SQL\" width=\"555\" height=\"428\" \/><\/a><\/p>\n<p>Click <strong>the Add Field intelligent<\/strong>\uff0cdialog box shown below appears, for the template to be filled in the fields and the corresponding data fields in the table, you can freely select the corresponding fields required.<\/p>\n<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub8.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub8.jpg\" alt=\"Add Field intelligent\" width=\"551\" height=\"430\" \/><\/a><\/p>\n<p>After the addition, click<strong>Smart add a cell<\/strong> fill in the corresponding cell. When you can choose <strong>not to participate in the cell does not change the update<\/strong>\uff0cwhich can accelerate the speed of data after completing the update. Add After clicking <strong>OK<\/strong>\uff0cto display the following chart\uff0cyou can see has been automatically generated SQL statement to update the database corresponding to the preview.<\/p>\n<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub9.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub9.jpg\" alt=\"Smart add a cell\" width=\"516\" height=\"446\" \/><\/a><\/p>\n<p>Add a built-in SQL2, database selection frDemo, mode is empty, select the Order Details table. In the same way smart add fields \u00e0 intelligent add a cell, set up after as shown<\/p>\n<p><a href=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub10.jpg\"><img loading=\"lazy\" class=\"centered\" src=\"http:\/\/www.finereport.com\/en\/wp-content\/themes\/fanruan\/images\/super-sub10.jpg\" alt=\"Smart add sql2\" width=\"520\" height=\"446\" \/><\/a><\/p>\n<p><strong>3.Save Preview<\/strong><\/p>\n<p>save as<br \/>\n<em>%FineReport_HOME%\/WebReport\/WEB-INF\/reportlets\/com\/doc\/form\/9.2.cpt<\/em><\/p>\n<p>Start the Report Server, click on the top right corner of the designer furnished preview, you can preview it fill up. Or direct data in the browser address:<br \/>\n<em>http:\/\/localhost:8075\/WebReport\/ReportServer?reportlet=com\/doc\/form\/9.2.cpt&amp;op=write<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As shown in the figure is a fill tables, divided into t&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[111],"tags":[117],"_links":{"self":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/2009"}],"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=2009"}],"version-history":[{"count":2,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/2009\/revisions"}],"predecessor-version":[{"id":10606,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/posts\/2009\/revisions\/10606"}],"wp:attachment":[{"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/media?parent=2009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/categories?post=2009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frg.fineres.com\/en\/wp-json\/wp\/v2\/tags?post=2009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}