Results 1 to 4 of 4

Thread: [RESOLVED] Formula.Text PRoblem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    169

    Resolved [RESOLVED] Formula.Text PRoblem

    Hi,
    I have a CrystalReport that is using a Formula in the SelectExpert to filter the information for the report. It is a report that displays output per Shift. I want to be able to run the report for a selected shift or for all shifts.
    My formula is being changed by:
    VB Code:
    1. rptSub.DataDefinition.FormulaFields("ShiftLetter").Text = Me.ShiftLetter
    and the SelectExpert is using the @ShiftLetter formula to filter the information like this: {rpt.....Shift} LIKE @ShiftLetter

    This is all working fine for any particular shift but when I want to run the report for all shifts, I can't get it to work. I have been trying to set ShiftLetter to % or '%' etc but none of the combinations seem to work.

    ANy ideas how to fix this?

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    169

    Re: Formula.Text PRoblem

    ANy ideas?

  3. #3
    Addicted Member mabbas110's Avatar
    Join Date
    Oct 2005
    Location
    Karachi , Pakistan
    Posts
    172

    Re: Formula.Text PRoblem

    dont do this thing.
    just try to use selection formula
    means
    rpt.selectionformula='shiftletter=' & me.shiftletter

    see also the help of crystal report for using selection formula.
    Thanks and Regards,

    Muhammad Abbas

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    169

    Re: Formula.Text PRoblem

    Hi,
    I've figured this out. I didn't think that the IN operator was available in CR formulas but it is.
    VB Code:
    1. RptToView.DataDefinition.FormulaFields("Shift").Text = "' [A, B, C, D, E]'"
    or
    VB Code:
    1. RptToView.DataDefinition.FormulaFields("Shift").Text = "' [A]'"

    Then, in the SelectExpert use
    VB Code:
    1. MyTable.Shift IN @Shift

    Dec.

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