Be sure to
check out our forum FAQ. You must register
to post messages. To view messages, select the forum that you want to visit from the selection below.

----
Please note: messages from the forum administrator are sometimes being rejected by Spam filters. Please make sure you can receive the administrator's messages by whitelisting forumadmin@dataaccess.com.

The Report
The report is a simple but at the same time a complex report. The report purpose is to show the 10 best performing sales persons in a company. The data is collected from the WebOrder sample data. The report runs through all orders and sub totals the extended price column of the order detail rows per sales person. The report groups the data by sales person name hiding the details section of the report (the order detail lines are not printed but the formulas in the section are executed). In the details section the extended price is used to create a running total value. To compare the results of a sales person the total amount of sales and different sales persons is calculated in a sub-report which is executed in the page header section. This means that the data is read twice (once for the sub-report and once for the main report). This and a couple of other things make the report look slow. The report itself is a good candidate report for adding charts in a next version of Visual Report Writer.

Integration
The report integration is similar to the integrations shown in the other blogs; The output is stored in a PDF file in the reports cache folder at the server and shown in a cWebIFrame control. The checkbox (cWebCheckbox) makes it possible to show the totalized sales figure for the other sales persons as 11th value. The checkbox value is used to set a report parameter which is used to determine if the report footer section should be suppressed or not.

The special feature of this report integration is the possibility to show report statistics. The Visual Report Writer engine sends multiple event messages during report execution passing information about load time of the report, time to read and sort the data, format the pages. This event is called OnReportStatistics. In the cVRWReport integration of this view this method is used to collect the information in a webproperty.

Synchronized properties can only be created based on a simple data-type such as string, integer etc. In this oStatisticsHandler object a string is used which will hold all the information about the report statistics. The values are stored in a value-pair way (type, separator, value), all concatenated in one string. The HandleReportStatisticsValues method finds the passed iType value and if present will add the iValue value to the already stored value. If the iType value is not found the member will be added. This is done with the following code:

The collected statics information can be viewed by clicking the tool-bar button for this. The tool-bar button opens a cWebModalDialog object for showing the information. For each possible statistics value a cWebLabel object will be present. Looking at Report Open the object code is:

Code:

Object oReportOpen is a cWebLabel
Set psLabel to "Report Open:"
Set pbShowLabel to True
Set psCaption to '--- ms'
Set peLabelAlign to alignRight
Set psCSSClass to "StatisticsValue"
End_Object

The CSS Class defined for this control is simple, it "only" makes the label bold.

Code:

#OWEBAPP .StatisticsValue .WebLabel_content{
font-weight: bold;
}

In the procedure to open the modal dialog the string with statistics information is parsed with the following code: