Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: crystal report formula for null parameter Post Reply Post New Topic
Author Message
ridhwaans
Newbie
Newbie


Joined: 05 Jun 2012
Online Status: Offline
Posts: 8
Quote ridhwaans Replybullet Topic: crystal report formula for null parameter
     Posted: 19 Jun 2012 at 3:34am
In Visual studio 2005, I using a listbox control to pass and set parameters for my crystal report using a crystal report viewer

So the record selection formula with my parameter field 'ID' is as follows:
{TableA.ID} = {?ID}

Note that the parameter field doesnt have any default values to show via the parameter prompt because the listbox is controlling the parameters

The report works fine for most of my parameters

But, a few of my parameters are null/ blank values (its just how the data is), so the parameter prompt tends to show up.
Instead, if a null parameter is received, how do I make crystal report display a blank page and avoid the parameter prompt?

if isnull({?parameter}) then
      {TableA.IDfield} = ?
else
        {TableA.IDfield} = {?parameter}


Please advise

thanks





Edited by ridhwaans - 19 Jun 2012 at 3:40am
IP IP Logged
harlylux
Newbie
Newbie


Joined: 08 Jan 2008
Online Status: Offline
Posts: 3
Quote harlylux Replybullet Posted: 19 Jun 2012 at 4:39am
You could just set up a missing or dummy value for null.

like this:

if isnull({?parameter}) then you can have CR give a blank page.
      {TableA.IDfield} = -999
else
        {TableA.IDfield} = {?parameter}

Then you can have the report

Edited by harlylux - 19 Jun 2012 at 4:39am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum