Skip to Content

Can SAP Crystal Reports accept a blank parameter?


I used SAP Crystal Reports 2008 to design a report.

I have 2 parameter fields which are displayed in the Selection Criteria Screen when the report is run:

(a) @Project

(b) PrefrdSortOrder

(a) For @Project, the User selects his project from a drop-down list

(b) For PrefrdSortOrder, the user can select one of 2 values :

- Original Order or

- Description

i.e the user can select how he wants the report to be sorted.

Normally, most users want the report to be sorted by "Original Order". Only rarely will a user want the report to be sorted by "Description"

My report works well until I make the following change....

If the User does not select a value, i.e if he leaves the "PredrdSortOrder" prompt BLANK, I want CR to behave as if the User has selected "Original Order", and sort the report in Original Order

However, I get this error message:

Error in Formula 'YourPreferredSortOrder_sv'

Parameter has no value


Note :

'YourPreferredSortOrder_sv is a Shared variable and its code is:

Shared StringVar YourPreferredSortOrder_sv;

IF {?PrefrdSortOrder} = 'Original Order' THEN 'Original (Line Num) Order'

TOTEXT ({?PrefrdSortOrder}) = " " THEN 'Original (Line Num) Order' // <- Apparently the error is here!

{?PrefrdSortOrder} = 'Description' THEN 'By Item Desc (Alphabetic)'


Can anyone help me?


Leon lai

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 09:11 AM

    Hi Leon,

    Try this formula ,

    IF {?PrefrdSortOrder} = 'Original Order' THEN 'Original (Line Num) Order'

    Not hasvalue ({?PrefrdSortOrder}) THEN 'Original (Line Num) Order'

    {?PrefrdSortOrder} = 'Description' THEN 'By Item Desc (Alphabetic)'

    Make sure that parameter Optional Prompt is True.

    -Rajesh N

    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.