Green bar printouts can be created by alternating the shading or background color of the report's Detail section in the Format event.
The following example shows what the code for the method looks like.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste JUST ABOVE the Detail Format event. |
Copy Code |
---|---|
Dim color As Boolean |
Visual Basic.NET code. Paste INSIDE the Detail Format event. |
Copy Code |
---|---|
If color = True Then Me.Detail1.BackColor = System.Drawing.Color.DarkSeaGreen color = False Else Me.Detail1.BackColor = System.Drawing.Color.Transparent color = True End If |
To write the code in C#
C# code. Paste JUST ABOVE the Detail Format event. |
Copy Code |
---|---|
bool color; |
C# code. Paste INSIDE the Detail Format event. |
Copy Code |
---|---|
if(color) { this.detail.BackColor = System.Drawing.Color.DarkSeaGreen; color = false; } else { this.detail.BackColor = System.Drawing.Color.Transparent; color = true; } |