|
-
Oct 27th, 2008, 11:35 PM
#1
Thread Starter
Lively Member
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 ..
New in programming world
-
Oct 28th, 2008, 05:35 AM
#2
Hyperactive Member
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
-
Oct 29th, 2008, 04:27 AM
#3
Thread Starter
Lively Member
Re: crystal report XI string is required
emmmm ..
still not getting it 
what do i really need to change!?
New in programming world
-
Oct 30th, 2008, 09:32 PM
#4
Hyperactive Member
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.
-
Nov 9th, 2008, 01:47 AM
#5
Thread Starter
Lively Member
Re: crystal report XI string is required
 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 !!
New in programming world
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|