Customer Vendor Relationship via SubReport¶
This report shows the relationship between the vendors and the customers in the system. Each page displays a customer at the top, with the vendors that sold a product to this customer listed underneath. This report utilizes a sub-report to look up potential relationships to the vendors in the system. For each identified customer, the sub-report collects the order information. If there are no orders for a customer, the report indicates, "No Vendors Delivered Products to This Customer." To obtain an overview that only shows customers with orders, use the Customer Vendor Relationship via Groups report. The data collection via groups is significantly faster than the sub-report version. Note that the sub-report version generates more pages with customer/vendor relationship information than this report (based on the current order entry data for DataFlex 2019/19.1).
The report demonstrates how to use a sub-report, including report linking via a global variable.
The ordering of customers can be controlled via a function in the main report, while the ordering of vendors can be controlled via a function in the sub-report. The functions stored in the report utilize one of the columns in the customer or vendor table. Any column that can be used for sorting can be employed in these functions; however, ensure that a column with unique values is selected. Otherwise, the report may not display all information as intended. For instance, replacing the {vendor.name} database column with {vendor.state} results in fewer vendors being shown per customer. The total sales value will remain the same, but individual line totals may be incorrect, as the report should display the vendor state instead of the vendor name.
The report also demonstrates the use of alternate row coloring in the list of vendors. While this is often controlled using the Mod() function on the Record Number special field, it now utilizes the Group Number special field.
The report header B, report footer A, and report footer B sections are dynamically suppressed based on the number of found vendors.
The group footer B section illustrates the use of a function to determine whether a new page should be generated. New pages are created only as long as customers are found.
The report is used in the CustomerVendorRelationshipReport.rv component.