I'm very new to crystal reports and my code issue isn't to complex, but I'm struggling find the right structure.

I have jobID's that all start with the same first 5 digits if they come from the same SalesOrderID. the five digits they start with are the salesID number.

I want to display all of the JobIDs under a SalesOrderID if the production is complete on just one of them.

if {Jobs.jmpProductionComplete} =-1.00
 then
(
  If {Jobs.jmpJobID} startswith left({Jobs.jmpJobID},5)
  then {Jobs.jmpJobID}
  else  ""
)

but that produced a error saying "The result of selection formula must be a boolean"

Next I tried:

if {Jobs.jmpProductionComplete} =-1.00  then
(
  If {Jobs.jmpJobID} startswith left({Jobs.jmpJobID},5)
  then not(isnull({Jobs.jmpJobID}))
)

But that only displayed the single JobID that has been marked Production Complete.

Next I tried:

  1. Created a formula with this code: left({Jobs.jmpJobID},5) named it @jobidformula

  2. Go to the Group Expert > Move this formula to the Group List

  3. Suppressed the Group Header and footer

  4. Go to Report > Selection Formulas > Group and used this code:

    Minimum({Jobs.jmpProductionComplete}, {@jobidformula}) = -1
    

still didn't work. Any other pointers anyone can give me?

1

There are 1 answers

0
Natalie Sheffield On

I figured it out!

I first made it so that my report only shows the JobIDs which production is complete grouped by salesOrderID

I made a subreport where the parameter was SalesOrderID

in the selection formulas I set it so that Production was not complete. I lined them all up and vooila! It works without issue.