{"id":109,"date":"2015-02-09T12:11:31","date_gmt":"2015-02-09T17:11:31","guid":{"rendered":"http:\/\/salzlechner.com\/dev\/?p=109"},"modified":"2016-03-11T07:10:04","modified_gmt":"2016-03-11T12:10:04","slug":"vpe-report-breaks","status":"publish","type":"post","link":"http:\/\/salzlechner.com\/dev\/2015\/02\/09\/vpe-report-breaks\/","title":{"rendered":"VPE Report Breaks"},"content":{"rendered":"<p>This post shows how to add breaks to a VPE report.<\/p>\n<p>Lets assume we have a report that prints order detail lines. Now we decide that we want a sub header and a sub total for each order. Lets add another sub header and sub total for the customer so that the report will show each customer than all the customers orders and then the detail to each order.<\/p>\n<p>The\u00a0following code will define the break conditions<\/p>\n<pre class=\"lang:default decode:true\">SZBREAK_BEGIN\r\n    SZBREAK orderhdr.customer_no\r\n    SZBREAK orderdtl.order_no\r\nSZBREAK_END\r\n<\/pre>\n<p>this code defines two break conditions. One on ordhdr.customer_no and one on orddtl.order_no<\/p>\n<p>the subheader and subtotal section can be defined as follows<\/p>\n<pre class=\"lang:default decode:true\">SZDEFINE_SECTION SZSUBHEADER 1 \"SubHeader1\" 100 FORCE_PAGEBREAK_NONE False\r\n    Procedure DoOutputSection                \r\n        \/\/ printing code goes here\r\n    End_Procedure\r\nSZEND_SECTION\r\n\r\nSZDEFINE_SECTION SZSUBTOTAL 2 \"Subtotal2\" 100 FORCE_PAGEBREAK_NONE False\r\n    Procedure DoOutputSection                \r\n        \/\/ printing code goes here\r\n    End_Procedure\r\nSZEND_SECTION<\/pre>\n<p>we can also define values to be calculated for subtotals. For example lets say we would like to keep track of the number of orders as well as the order amount total<\/p>\n<pre class=\"lang:default decode:true\">\/\/ subtotals for break#1 \r\nSZDEFINE_SUBTOTALS 1\r\n    SZADD_SUBTOTAL \"ORDERS\" 1\r\n    SZADD_SUBTOTAL \"AMOUNT\" orddtl.amount\r\nSZENDDEFINE_SUBTOTALS\r\n\r\n\/\/ subtotals for break#2\r\nSZDEFINE_SUBTOTALS 1\r\n    SZADD_SUBTOTAL \"ORDERS\" 1\r\n    SZADD_SUBTOTAL \"AMOUNT\" orddtl.amount\r\nSZENDDEFINE_SUBTOTALS\r\n\r\n<\/pre>\n<p>to print the subtotal value we can use the following code<\/p>\n<pre class=\"lang:default decode:true \">SZDEFINE_SECTION SZSUBHEADER 1 \"SubHeader1\" 100 FORCE_PAGEBREAK_NONE False\r\n    Procedure DoOutputSection                \r\n        \/\/ print total amount for this customer\r\n        Send szWritelnPos (GetSubtotal(Self,1,\"AMOUNT\"))\r\n    End_Procedure\r\nSZEND_SECTION\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using report breaks in VPE reports<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","ngg_post_thumbnail":0,"footnotes":""},"categories":[6,23],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-dataflex","category-vpe-for-vdf"],"_links":{"self":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":2,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":282,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/109\/revisions\/282"}],"wp:attachment":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}