Symptom
Created a datawindow that has an expression in the detail band for changing the background based on the value of a column. It works when in a regular datawindow control, but it fails when the datawindow is used as a report in a composite datawindow.
Environment
PowerBuilder
Reproducing the Issue
1. In the DataWindow painter right click on the detail band of the datawindow and select properties.
2. Click on the Background tab in the properties and then click on the Expression icon for Color to bring up the Expression Builder. The expression below will create a blue background for a false value and red for a true value:
3. The datawindow expression works when as a simple datawindow as follows:
4. When the same datawindow is put in as a report in composite datawindow the background colors fail to display. The department datawindow in the composite that works has a similar expression, but the expression is in the column and not the detail band:
Cause
The background expression is not working because additional properties need to be set for both the reports in the composite datawindow and each individual datawindow.
Resolution
To resolve the problem do the following:
1. Select each report in the composite datawindow and select Show Background in the properties General tab:
2. Select Preview Shows Background on the properties Print Specifications tab for each individual datawindow:
3. The datawindow with the detail band background color expression now displays as expected: