Results 1 to 5 of 5

Thread: hide or show text object in a report

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    9

    hide or show text object in a report

    i have a crystal report (8.0) , in my report i have one control (amount) and on text object. i want to change the caption of text object if the amount field is less than (10000) to be "good" and if the amount is greater than (10000) to be excelent

    solution please
    thanks

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: hide or show text object in a report

    You can't change the "caption" of a Text object at runtime. However it is easy to accomplish what you want. All you need to do is to create a Formula, something like

    If {Orders.Amount} > 10000 Then "Excellent" Else "Good"

    Delete the Text object from the report and print the Formula in its place.

    Or insert the Formula Field into the Text object.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    9

    Re: hide or show text object in a report

    in fact i can't use this formula because formula editor is not supporting my language "arabic" i thought to solve it like this
    i will create two text objects one will have the caption "good" and the other "excelent" then i can hide and show either of them through some code but i don't know how

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: hide or show text object in a report

    then i can hide and show either of them through some code but i don't know how
    The only way to write "code" in Crystal is via Formulas, which you would need in order to Suppress a Text object.

  5. #5
    Junior Member
    Join Date
    Feb 2006
    Posts
    27

    Re: hide or show text object in a report

    You can't use a text object, you must use a formula or the database field... First, focus the control, right click with your mouse, select Format Field, Common, and "Display String"...

    Put the following formula:

    If {@Valor1} > 10000 Then
    "excelent"
    Else
    "good"

    The Bold value you can change it with a formula field or with a database field...
    If you want to display the value and the text, use a formula in the right of the value.
    If you don't want to display the value but you want to show the text, use the display field option in the database field.

    Regards,
    Tribo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width