Hi all!
Step on an annoying thing yesterday(DF 18 and Crystal XI).
I have two 'almost' exact looking ComRecordSelectionFormulas.
Code:
//With string "0"(zero) in sSarskild
Move (sSelection+(If(sSelection<>""," and ",""))+"{RECEPT.SARSKILT} ="+(Trim(sSarskild))+(If(sSelection<>""," and ","")+"{RECEPT.DATUM} = "+(WinQL_Date(dFromSjtypantStatusdat)))) to sSelection
Set ComRecordSelectionFormula of hoReport to sSelection
//With string "1" in sSarskild
Move (sSelection+(If(sSelection<>""," and ",""))+"{RECEPT.SARSKILT} ="+(Trim(sSarskild))+(If(sSelection<>""," and ","")+"{RECEPT.DATUM} = "+(WinQL_Date(dFromSjtypantStatusdat)))) to sSelection
Set ComRecordSelectionFormula of hoReport to sSelection
The resulting selection strings are:
Code:
//Not working
{RECEPT.PNR}="198808112380" and {RECEPT.SARSKILT} =0 and {RECEPT.DATUM} = Date (2018, 08, 24)
//Working
{RECEPT.PNR}="198808112380" and {RECEPT.SARSKILT} =1 and {RECEPT.DATUM} = Date (2018, 08, 27)
The difference is the string value "1" versus "0".
With value "1" it works fine, and the report prints on screen.
BUT, when value is "0", an error pops up first time the print button is clicked.
If I click Print button a second time, it works!
I guess I'm missing something that has to do´with null values and strings here :-)
Any answers appreciated!
Best Regards
Mikael Olsson, RixData
Sweden