change font color to white depending on a value
I have been trying Fast Reports for a few days so far, but I have not been able to do this:
I need to change the font color to white for two texbobjects and a lineobject depending on the value of the second textobject which text property is : [QUOT_CC.TOT_DISC], this is the total discount of a quotation in my database. If the value is zero then change the font color to white so nothing is printed and our customer does not see: 'Commercial 'Discount 0.00' neither a line below that figure, what follows is the tax and a final total.
Your help is much appreciated. Thanks
Bob
Within the Public Class ReportScript I have written for the events BeforePrint these code lines:
'the label Commercial 'Discount
Private Sub Text28_BeforePrint(ByVal sender As Object, ByVal e As EventArgs)
If Val (Text16.Value) = 0 then
Text28.Visible = False
Text28.TextColor = Color.White
else
Text28.Visible = True
Text28.TextColor = Color.Black
End If
End Sub
'the total discount 0.00
Private Sub Text16_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
If Val (Text16.Value) = 0 then
Text16.Visible = False
Text16.TextColor = Color.White
else
Text16.Visible = True
Text16.TextColor = Color.Black
End If
End Sub
'the line _________________
Private Sub Line3_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
If Val (Text16.Value) = 0 then
Line3.Visible = False
Line3.Border.Color = Color.white
else
Line3.Visible = True
Line3.Border.Color = Color.Black
End If
End Sub
and sometimes it works, nothing is printed for those objects, but some other times it does not work (the label, the discount 0.00, and the line are printed).
Thanks again !
I need to change the font color to white for two texbobjects and a lineobject depending on the value of the second textobject which text property is : [QUOT_CC.TOT_DISC], this is the total discount of a quotation in my database. If the value is zero then change the font color to white so nothing is printed and our customer does not see: 'Commercial 'Discount 0.00' neither a line below that figure, what follows is the tax and a final total.
Your help is much appreciated. Thanks
Bob
Within the Public Class ReportScript I have written for the events BeforePrint these code lines:
'the label Commercial 'Discount
Private Sub Text28_BeforePrint(ByVal sender As Object, ByVal e As EventArgs)
If Val (Text16.Value) = 0 then
Text28.Visible = False
Text28.TextColor = Color.White
else
Text28.Visible = True
Text28.TextColor = Color.Black
End If
End Sub
'the total discount 0.00
Private Sub Text16_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
If Val (Text16.Value) = 0 then
Text16.Visible = False
Text16.TextColor = Color.White
else
Text16.Visible = True
Text16.TextColor = Color.Black
End If
End Sub
'the line _________________
Private Sub Line3_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
If Val (Text16.Value) = 0 then
Line3.Visible = False
Line3.Border.Color = Color.white
else
Line3.Visible = True
Line3.Border.Color = Color.Black
End If
End Sub
and sometimes it works, nothing is printed for those objects, but some other times it does not work (the label, the discount 0.00, and the line are printed).
Thanks again !
Comments