{"id":241,"date":"2016-03-02T10:23:04","date_gmt":"2016-03-02T15:23:04","guid":{"rendered":"http:\/\/salzlechner.com\/dev\/?p=241"},"modified":"2016-03-11T06:52:51","modified_gmt":"2016-03-11T11:52:51","slug":"using-vpe-reports-in-webapp","status":"publish","type":"post","link":"http:\/\/salzlechner.com\/dev\/2016\/03\/02\/using-vpe-reports-in-webapp\/","title":{"rendered":"Using VPE Reports in WebAPP"},"content":{"rendered":"<p>One of the nice features of the VPE classes offered by StarZen Technologies is the ability to use the same report object for both desktop as well as WebAPP reporting<\/p>\n<p>For a desktop application the report is contained in an report\u00a0view based on the cszVpeReportView class whereas in WebAPP you simply use the\u00a0cszVpeReportWebView class<\/p>\n<p>Then in both places you can run the report. In a desktop application the report can be either shown as a preview in a popup window or in an embedded preview window inside your view or it can save to a number of different file formats including a VPE format, PDF, HTML and even DOCX.<\/p>\n<p>In the WebAPP the document is created and then sent to the client as a PDF document that can then be shown either in a popup, another tab or embedded in the same tab.<\/p>\n<p>Her is an example showing the result of the customer sample report<\/p>\n<p><a href=\"http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/03\/vpesample.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-242\" src=\"http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/03\/vpesample.png\" alt=\"vpesample\" width=\"978\" height=\"689\" srcset=\"http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/03\/vpesample.png 978w, http:\/\/salzlechner.com\/dev\/wp-content\/uploads\/sites\/2\/2016\/03\/vpesample-300x211.png 300w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/a><\/p>\n<p>and here is what the code for the report looks like<\/p>\n<pre class=\"lang:default decode:true \">    Object oColumnReport is a cszVpeColumnReport_V2\r\n        Set Main_File to CUST.file_number\r\n        \r\n        Set ordering to 1\r\n        \r\n        Procedure OnConstrain\r\n            String sCustFrom sCustTo\r\n            \r\n            WebGet psValue of oFromCustomerCustomerNumber to sCustFrom\r\n            WebGet psValue of oToCustomerCustomerNumber to sCustTo\r\n            \r\n            Constrain CUST.NUM ge sCustFrom\r\n            If (trim(sCustTo)&lt;&gt;\"\") Constrain CUST.nUm ge sCustTo            \r\n        End_Procedure\r\n        \r\n        \/\/ Column Definitions\r\n        Object oIDColumn is a cszVpeReportColumn \r\n            Set psCaption to \"ID\"\r\n            Set piWidth to 8\r\n            \r\n            Function ColumnValue Returns String\r\n                Function_Return (trim(CUST.NUM))\r\n            End_Function \r\n        End_Object\r\n        \r\n        Object oNameColumn is a cszVpeReportColumn \r\n            Set psCaption to \"Name\"\r\n            Set piWidth to 20\r\n            \r\n            Function ColumnValue Returns String\r\n                Function_Return (trim(CUST.NAME))\r\n            End_Function \r\n        End_Object\r\n\r\n        Object oAddressColumn is a cszVpeReportColumn \r\n            Set psCaption to \"Address\"\r\n            Set piWidth to 20\r\n            \r\n            Function ColumnValue Returns String\r\n                Function_Return (trim(CUST.ADDRESS1))\r\n            End_Function \r\n        End_Object\r\n\r\n        Object oCityColumn is a cszVpeReportColumn \r\n            Set psCaption to \"City\"\r\n            Set piWidth to 12\r\n            \r\n            Function ColumnValue Returns String\r\n                Function_Return (trim(CUST.CITY))\r\n            End_Function \r\n        End_Object\r\n\r\n        Object oBalanceColumn is a cszVpeReportColumn \r\n            Set psCaption to \"Balance\"\r\n            Set piWidth to 18\r\n            Set piTextAlignment to VPE_ALIGN_RIGHT\r\n            Set pbTotal to True\r\n            Set pnTotalFormat to 8.2\r\n            Set pbTotalThousandsFormatting to True\r\n            \r\n            Function ColumnValue Returns String\r\n                Function_Return (szFormatToDecimalsEx(cust.balance,10.2,True))\r\n            End_Function \r\n        End_Object\r\n\r\n        Object oPageHeader is a cszVpePageHeaderSection\r\n            Set psPageTitle to \"StarZen Technologies, Inc\"\r\n            Set psPageSubtitle to \"Column Report Sample V2\"\r\n            Set piSectionHeight to 150\r\n        End_Object\r\n        \r\n        Object oPageTitle is a cszVpePageTitleSection\r\n            Set piSectionHeight to 50\r\n        End_Object\r\n        \r\n        Object oBody is a cszVpeBodySection\r\n            Set piSectionHeight to 50\r\n            Set pbOverrideFormatting to True\r\n        End_Object\r\n\r\n        Object oTotal is a cszVpeTotalSection\r\n            Set piSectionHeight to 100\r\n        End_Object\r\n                \r\n        Object oPageFooter is a cszVpePageFooterSection\r\n            Set piSectionHeight to 200\r\n        End_Object\r\n    End_Object    \/\/ oColumnReport<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you already have a number of VPE reports written in VPE for DataFlex with the VPE classes from StarZen Technologies this post will show you how you can use these same reports in a DataFlex WebAPP<\/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,27,23],"tags":[],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-dataflex","category-dataflex-webapp","category-vpe-for-vdf"],"_links":{"self":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/241","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=241"}],"version-history":[{"count":3,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":268,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/241\/revisions\/268"}],"wp:attachment":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}