Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I allow my users leave their report parameter blank

Status
Not open for further replies.
Jul 28, 2011
167
NG
Hi everyone,I'm working on a report portal and I encountered an Issue.I want users to be able to leave any of the parameter blank. I've tried this for the three major fields I have.
Code:
[red]
if IsNull({?End Date}) then 
      {rectReport.Call date} in DateTimeValue('1753-01-01 00:00:00') to CurrentDateTime 
   else   {rectReport.Call date} in {?Start Date} to {?End Date}and
 if IsNull({?Engine Down}) then
        {rectReport.EngineDown} in 0 to 1
[/red]
What does anyone think I can do?All responses are highly appreciated.
 
I didn't see this post before responding in the other forum telling you to repost. You need to identify your CR version as the solution depends upon that.

-LB
 
I don't have access to CR10, so what problem did you encounter when you tried your formula? Did you get an error message? What was it?

-LB
 
What issue?
For Date and Number parameters CR10 requires a value for every parameter, only strings can be left blank.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks for you posts, The reports is always saying "you must enter a date". But even then when I choose a date and leave the boolean empty, it still complains of an empty field. This is the code I used
Code:
if IsNull({?End Date}) then 
      {rectReport.Call date} in DateTimeValue('1753-01-01 00:00:00') to CurrentDateTime
    else   {rectReport.Call date} in {?Start Date} to {?End Date}
and 
if ({?Engine Down} = 3) then
        {rectReport.EngineDown} in 0 to 1
 
I answered your original post, having missed this reply. (Which is still the wrong forum, in my view, formulas belong in forum 1.)

A basic feature of Crystal is that you have to go along with certain standard methods. It is not a full computer language and there are things you can't get it to do by direct methods.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
You should use the prompt text to instruct users to select a date like datetime(9999,9,9,0,0,0) if they want to see results for all dates, and then use a formula like this:

(
(
{?EndDateTime} = datetime(9999,9,9,0,0,0) and
{rectReport.Call date} in datetime(1753,1,1,0,0,0) to currentdatetime
) or
(
{?EndDatetime} <> datetime(9999,9,9,0,0,0) and
{rectReport.Call date} in {?Start Date} to {?End Date}
)
) and
(
(
{?Engine Down} = 9999 and
{rectReport.EngineDown} in 0 to 1
) or
(
{?Engine Down} <> 9999 and
{rectReport.EngineDown} = {?EngineDown}
)
) //etc.

-LB
 
I think my situation is similar to the original question posted here. Please let me know if I am off base and I will start a new thread.

I am using Crystal 10.

I have a report that we had to include a parameter to satisfy one user. In the Select is this stmt: (this is only part of the select stmt)
Code:
...
{Orders.Status_Enum} = {?Order Status} and
...

There are two possible values to select and it can either be one or both. How do I allow other users to skip this parameter so that they get all orders?

TIA!

~RLG
 
I figured out a solution to this. I selected a value of 0.00 in the Edit Parameter Field | Default Values window with a description of "All records". Then in the Selection Formula, I added
Code:
...
({Orders.Status_Enum} = {?Order Status} or {?Order Status} = 0.00) and
...

It seems to work perfectly!

~RLG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top