Skip to Content
author's profile photo Former Member
Former Member

Creating multiple sorting options using a static parameter

Im fairly new to Crystal Reports and I had a question about a report i'm working on. Does any have ideas on how to create a paremeter that allows the user to select one of two sorting sequences without using a dynamic cascading paremeter. It has to be a static parameter. I have figured out how to create the parameter, but I'm having a hard time creating the sorting options based off of the user response.

For Example:

Sort Option 1. Product Manager - Vendor - Accont Manager

Sort Option 2 Production Manager - Sold to - Product Description

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Aug 11, 2008 at 10:07 AM

    You could create a new formula in which you check which parameter value was chosen by the user, and return the appropriate db field accordingly:

    if {?sortorder} = "Birth Date" then {Employee.Birth Date} else {Employee.Hire Date}

    then use your new formula field as the sort field in record sort expert.

    If you need three sort levels, just create three formula fields with the above logic, just changing the db fields to be returned by the formula.

    Cheers,

    Fritz

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2008 at 02:04 PM

    try this

    (IF {?Sort}='Vendor Number' THEN {Pr_Voucher_Status;1.vendkey}& " "& {Pr_Voucher_Status;1.ap_remt_key}

    & " " & {@date}

    else

    IF {?Sort}='Invoice Number' THEN {Pr_Voucher_Status;1.ap_vchr_invno}& " " & {Pr_Voucher_Status;1.vendkey}&

    " " &{@date}

    Place this in a formula, then create a group from it. it needs to be the first group in the report.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.