[]
        
(Showing Draft Content)

Create Green Bar Report

In a section report, green bar printouts can be created by setting alternate shades or background color in the report's detail section in the Format event. The following steps demonstrate how to create a Green Bar report in a sample report PurchaseOrder.rpx that can be can be downloaded from GitHub: ..\Samples19\DesignerPro\ReportsGallery\Reports\Section Report\.

Design Report Layout

Design green bar report layout

  1. On the design surface of the report, double-click the detail section of the report to create an event handling method for the Detail Format event.

  2. Add the following script to create alternate background colors.

    Dim i As Integer = 0
    
    If i Mod 2 = 0 Then
        Me.detail.BackColor = System.Drawing.Color.PaleGreen
    Else
        Me.detail.BackColor = System.Drawing.Color.Transparent
    End If 
    i += 1
    
    int i = 0;
    
    if (i % 2 == 0) {
      this.detail.BackColor = System.Drawing.Color.PaleGreen;
    } else {
      this.detail.BackColor = System.Drawing.Color.Transparent;
    }
    i++;
    
  3. Preview the report and see a Green Bar report alternating between Transparent and Pale Green backgrounds.