crystal report XI string is required
Good morning ,,
I've been through an error that is really driving me crazy since two days ..
I tried to solve it ..
No way !!
I have an error in my crystal report (report) .. each time I tried to run that report ..
am getting an error saying : a string is required here .. after i click ok .. i see myself in the formula workshop ..
with an error saying : if not isNull({@StartDate}) and {@StartDate} = 2.00 then 128 else
DefaultAttribute;
StartDate is a datetime field in my DB .. and am converting it to a text here ..
the syntax for converting am using is : totext(StartDate({vwTiming.StartDate}),"HH:mm")
I'm using crystal report XI
I really don't understand what is the problem ..
Re: crystal report XI string is required
I think your problem may be that the 128 is a number and may need to be a string based on the field. You are using DefaultAttribute so if the default resolves to a string then the "then" portion of your If statement must be string also.
Now, the DefaultAttribute is usually found when you are doing conditional formatting like changing fonts based on the values of a field, etc. So if you are changing from Regular to Bold, then the default may be Regular which is a string. So maybe if the words DefaultAttribute are not in the Functions area of the Formula Workshop then you may need to find something else for the Else.
Hope this helps
Re: crystal report XI string is required
emmmm ..
still not getting it :(
what do i really need to change!?
Re: crystal report XI string is required
Assuming @StartDate is the formula
Code:
totext(StartDate({vwTiming.StartDate}),"HH:mm")
Try
Code:
if not isNull({@StartDate}) and {@StartDate} = "2.00"
Since @StartDate resolves to a text value you need to compare it to a text value, not a number.
Re: crystal report XI string is required
Quote:
Originally Posted by rasinc
Assuming @StartDate is the formula
Code:
totext(StartDate({vwTiming.StartDate}),"HH:mm")
Try
Code:
if not isNull({@StartDate}) and {@StartDate} = "2.00"
Since @StartDate resolves to a text value you need to compare it to a text value, not a number.
where should I try ur code??
and what do you mean by comparing ..!?
am not comparing it to a number ..
there error: string is reqired here,, is showing for a font color ..!
but I don't know how to fix it !!