locked
How to display string in crystal report instead of showing true and false? RRS feed

  • Question

  • Hi all,

    I need to display a string in crystal report instead of showing boolean value from database. I have a table that contains a column name called "FeesPaid" as boolean datatype. If it gets stored as true means then the student paid his fees else it gets stored false. I need to display this in crystal report. I am drag this column in crystal report. If I drag this column at the runtime it display true or false.

    But, I need to display "Paid" if the value "true" means else I need to display "Not Paid" in the crystal report. How to change this and display in crystal report?

    it very urgent...

    Thanks
    R.E
    sridar
    Tuesday, December 16, 2008 1:50 PM

Answers

  • Hi sridaran

    In the field explorer (to  the left) right click on Formula Fields and select New

    Give the formula a name and click on Use Editor

    ...put the code in Joe's example in it and then save and exit.

    Then drag the formula onto your report like you did with the field.


    Hope this helps

    Regards

    Jon Royales
    Wednesday, December 17, 2008 5:33 PM

All replies

  • Use a formula.

    if {FeesPaid} = true then
    "Paid"
    else
    "Not Paid"
    Tuesday, December 16, 2008 3:09 PM
  • Hi,

    How to set the formula to the bound column(i mean that column).?
    I have drag a column from the database column into the crystal report. I need add the formula for that particular column..
    How to do that?

    Thanks
    R.E
    sridar
    Tuesday, December 16, 2008 3:19 PM
  • Hi sridaran

    In the field explorer (to  the left) right click on Formula Fields and select New

    Give the formula a name and click on Use Editor

    ...put the code in Joe's example in it and then save and exit.

    Then drag the formula onto your report like you did with the field.


    Hope this helps

    Regards

    Jon Royales
    Wednesday, December 17, 2008 5:33 PM
  • in Joe formula
    if {FeesPaid} = true then
    "Paid"
    else
    "Not Paid"

    i want to hide a column  e.g
    if {FeesPaid} = true then
    FeesPaid.visible =false
    else
    "Not Paid"
    FeesPaid.visible =true


    here FeesPaid is a column.
    Tuesday, April 21, 2009 10:13 AM

  • @Om Singh

    To hide the field you would use the "Suppress" formula on that field. The field will be suppressed if the result of formula is true. So the suppress formula would simply be

    {FeesPaid}

    assuming that's a boolean/bit column.
    Wednesday, April 22, 2009 5:32 PM