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

For a desktop application the report is contained in an report view based on the cszVpeReportView class whereas in WebAPP you simply use the cszVpeReportWebView class

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.

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.

Her is an example showing the result of the customer sample report

vpesample

and here is what the code for the report looks like

    Object oColumnReport is a cszVpeColumnReport_V2
        Set Main_File to CUST.file_number
        
        Set ordering to 1
        
        Procedure OnConstrain
            String sCustFrom sCustTo
            
            WebGet psValue of oFromCustomerCustomerNumber to sCustFrom
            WebGet psValue of oToCustomerCustomerNumber to sCustTo
            
            Constrain CUST.NUM ge sCustFrom
            If (trim(sCustTo)<>"") Constrain CUST.nUm ge sCustTo            
        End_Procedure
        
        // Column Definitions
        Object oIDColumn is a cszVpeReportColumn 
            Set psCaption to "ID"
            Set piWidth to 8
            
            Function ColumnValue Returns String
                Function_Return (trim(CUST.NUM))
            End_Function 
        End_Object
        
        Object oNameColumn is a cszVpeReportColumn 
            Set psCaption to "Name"
            Set piWidth to 20
            
            Function ColumnValue Returns String
                Function_Return (trim(CUST.NAME))
            End_Function 
        End_Object

        Object oAddressColumn is a cszVpeReportColumn 
            Set psCaption to "Address"
            Set piWidth to 20
            
            Function ColumnValue Returns String
                Function_Return (trim(CUST.ADDRESS1))
            End_Function 
        End_Object

        Object oCityColumn is a cszVpeReportColumn 
            Set psCaption to "City"
            Set piWidth to 12
            
            Function ColumnValue Returns String
                Function_Return (trim(CUST.CITY))
            End_Function 
        End_Object

        Object oBalanceColumn is a cszVpeReportColumn 
            Set psCaption to "Balance"
            Set piWidth to 18
            Set piTextAlignment to VPE_ALIGN_RIGHT
            Set pbTotal to True
            Set pnTotalFormat to 8.2
            Set pbTotalThousandsFormatting to True
            
            Function ColumnValue Returns String
                Function_Return (szFormatToDecimalsEx(cust.balance,10.2,True))
            End_Function 
        End_Object

        Object oPageHeader is a cszVpePageHeaderSection
            Set psPageTitle to "StarZen Technologies, Inc"
            Set psPageSubtitle to "Column Report Sample V2"
            Set piSectionHeight to 150
        End_Object
        
        Object oPageTitle is a cszVpePageTitleSection
            Set piSectionHeight to 50
        End_Object
        
        Object oBody is a cszVpeBodySection
            Set piSectionHeight to 50
            Set pbOverrideFormatting to True
        End_Object

        Object oTotal is a cszVpeTotalSection
            Set piSectionHeight to 100
        End_Object
                
        Object oPageFooter is a cszVpePageFooterSection
            Set piSectionHeight to 200
        End_Object
    End_Object    // oColumnReport