Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Nottingham, UK, Nottinghamshire, England
    Posts
    190
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Crystal Reports parameter with formula field (Crystal Reports)

    Sorry to ask for something that's not strictly Office related - I'm using the standalone version of Crystal - but it does have a loose connection and many people on this site will be familiar with Crystal Reports so I hope you'll humour me.

    I have a report that I wish to add a date parameter to. Specifically, I want to ask for a start date (no problem there), but I'd like to offer as a default value the date of the coming Saturday. I have a formula field to calculate that value which is currently used as the selection date, but is there any way of offering up this calculation as the default parameter value? To me as a new Crystal user, it looks like the parameter field will only accept database lookup values or hardcoded values, not calculated fields. True or not, anyone?

    Thanks in advance for any guidance on this.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Crystal Reports parameter with formula field (Crystal Reports)

    The article Programmatically add or update default values list of parameters in Crystal Reports with VB shows how you can set default values using VBA. The example uses values from a table, but you can use a calculated expression as well. HTH

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Nottingham, UK, Nottinghamshire, England
    Posts
    190
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crystal Reports parameter with formula field (Crystal Reports)

    Thanks for that Hans. However, the type libraries and programming mentioned in the article are only available in a VB project, not within Crystal itself. So from such a project, it shows how you can programmatically alter the report parameter default values BEFORE actually running the report. However, I can't do this as we will be running the report from Crystal Enterprise, not from a VB front end. And I don't see any way of programmatically offering a default value for a parameter unless somehow you can use an already-defined formula field (in effect the 'programmatically' bit). Thanks anyway.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Crystal Reports parameter with formula field (Crystal Reports)

    I'm afraid you're stuck then, but perhaps someone else will come up with an idea.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •