Results 1 to 5 of 5

Thread: crystal report XI string is required

  1. #1

    Thread Starter
    Lively Member nudge's Avatar
    Join Date
    Apr 2007
    Location
    There !
    Posts
    111

    Question 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

  2. #2
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    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

  3. #3

    Thread Starter
    Lively Member nudge's Avatar
    Join Date
    Apr 2007
    Location
    There !
    Posts
    111

    Re: crystal report XI string is required


    emmmm ..
    still not getting it

    what do i really need to change!?
    New in programming world

  4. #4
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    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.

  5. #5

    Thread Starter
    Lively Member nudge's Avatar
    Join Date
    Apr 2007
    Location
    There !
    Posts
    111

    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 !!
    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
  •  



Click Here to Expand Forum to Full Width