Is there any way to change text of text object on crystal reports using a condition.
I know I can change for example some colors (I have no idea, but I know it is possible) It exist something similar on crystal report to change开发者_运维技巧 text of a text object?
For example the label control on winforms has the attribute "text" and I can change it on the fly.
I would like to do something similar with crystal reports 2008
thank you.
If you want a textbox with dynamic content I think you would be much better off using a Forumla Field. A Formula Field gives you the option to set text on a "textbox" similar to a winform.
For instance lets say you have a report where you need to count certain items and then put some text that says whether they reached a certain goal or not. You could add a forumla field to the report and then write some code like this:
If Count ({TicketItems.CouponCode}, {TicketItems.StoreID}) > 100 Then
"Reached Goal"
Else
"Missed Goal"
In that example I am counting the coupon codes, which are grouped by a store id and then displaying whether the goal of 100 was reached or not. You can use what ever conditions that make sense for your report. And although a Formula Field is not a label in the sense of a WinForm label it can certainly be used for that purpose.
精彩评论