Search code examples
crystal-reportsreport

Show different data from 3 columns in one column but in separated rows


i have some troubles with this situation in Crystal Reports, i have 3 columns with diferent data in each one, but i want to show them in one column but in different rows, i think is like an union equivalent in SQL, but im not sure, i have tried with an if but it doesn't work, heres an example that what i want to do:

My 3 columns if i put them separated, they display like this:

enter image description here

and i want to show them like this:

enter image description here


Solution

  • You could create a formula field with a formula like this

    If Not IsNull({Data1}) Then {Data1}
    Else If Not IsNull({Data2}) Then {Data2}
    Else If Not IsNull({Data3}) Then {Data3}
    

    (Values in square brackets are placeholders for your columns, you can add them in formula workshop dialog.)

    Then place the new formula field into the report.