Pass Null To Crystal Report Parameter


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Pass Null To Crystal Report Parameter

  1. #1
    Join Date
    Dec 2003
    Posts
    52

    Pass Null To Crystal Report Parameter

    I have a Crystal Report (version 8.5) that I'm trying to display in a VB 6 program. I'm using the Report Viewer OCX. The report works off of a stored procedure in SQL Server and some of the parameters allow a null value. When I try to do this:

    param.Value = null

    VB gives me errors (wrong data type or object required). I can't seem to get past this. I don't want Crystal to show its parameter dialog, and I don't want to force the user to enter values that aren't required.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    If you don't get an answer here, try searching for "null parameter" at http://support.businessobjects.com/search/
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jun 2004
    Location
    Houston area
    Posts
    557
    Why not pass an empty string?

    If IsNull(<whatever> ) Then param.Value = ""

    L

    This parameter passing is REALLY chapping my ***!

    L
    A balanced diet is a cookie in each hand.

  4. #4
    Join Date
    Dec 2003
    Posts
    52
    Thanks for the replies. I was able to work around the problem by passing zero's for the parameters instead of null. I had to change the stored proc in SQL to get it to work, but I'm getting the results I need.

    For Laurel, these parameters were specified as Integer so empty strings wouldn't work. Thanks anyway.

  5. #5
    Join Date
    Jun 2004
    Location
    Houston area
    Posts
    557
    Then, if you don't want the 0's to show on your report, you can do something like this in your report textboxes:

    =IIf([Monitored]<>0,[Monitored],"")

    L
    A balanced diet is a cookie in each hand.

  6. #6
    Join Date
    Dec 2003
    Posts
    52
    Thanks for the info. Fortunately the parameter values are not actually printed on the report. They are used to get the appropriate recordset.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center