Results 1 to 6 of 6

Thread: Crystal Report Add One Report Parameter = Missing Parameter Values

  1. #1

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Angry Crystal Report Add One Report Parameter = Missing Parameter Values

    Hi

    I have a report, that has 3 subreports, i only pass one parameter to the main report, and the subreports are associated with this parameter. Everything was working fine...

    Now i need to change the report title at "runtime", so i created a new parameter "TitleChange" has boolean, and after that created a formula that checks the value of TItleChanged parameter, if true returns one string, if not returns another. After this just dragged the formula to the header of the main report.

    In preview mode everything is working fine.

    But when i set the new parameter by code it says "Missing parameter values"

    I'm setting the parameters like this:
    vb.net Code:
    1. Rel.Load(Server.MapPath("~/Reports/MyReport.rpt"), CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy)
    2. Rel.SetParameterValue("@ID", id)
    3. Rel.SetParameterValue("TitleChange", False)
    If i remove the new parameter from the report, everything works fine again?!!?

    What i'm missing here?!!

    THanks

    Rate People That Helped You
    Mark Thread Resolved When Resolved

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Crystal Report Add One Report Parameter = Missing Parameter Values

    It's been some time since I've dealt with CR ... but... as a first guess... there's a difference in the parameter names:
    Rel.SetParameterValue("@ID", id) <---- works
    Rel.SetParameterValue("TitleChange", False) <--- guessing this doesn't work.


    Could that be the issue?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: Crystal Report Add One Report Parameter = Missing Parameter Values

    Already tested that, same problem

    Rate People That Helped You
    Mark Thread Resolved When Resolved

  4. #4

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: Crystal Report Add One Report Parameter = Missing Parameter Values

    Finally i isolated the problem...

    First in two of the three subreports, the data comes from stored procedures each one of them has 2 input parameteres, where one it's optional, if i don't pass anything they're null by default for both SPs.
    The other parameter is related to the the ID parameter, like i said before.
    So i have 2 paths, if I remove the Report Parameter that i need for the title, the report works fine, if I add the parameter, the report complains about missing values...

    So the only way that i see to solve this, is by setting the value for the optional parameters, but when i try to set it to DBNULL.VALUE or NOTHING/NULL, it complains about incompatible types.
    I tried in the formula editor to create a simple formula to return a NULL value, and then use this formula to link to the subreport, but i don't know how to or if it's even possible.

    Thanks

    Rate People That Helped You
    Mark Thread Resolved When Resolved

  5. #5

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: Crystal Report Add One Report Parameter = Missing Parameter Values

    I didn't found out how to send the NULL value, but in this specific case i can send 0 that's the same thing...
    So this how:
    vb.net Code:
    1. 'Set the subreports vars
    2. Rel.SetParameterValue("@IDPEs", "0", "SubReportOne.rpt")
    3. Rel.SetParameterValue("@IDPEs", "0", "SubReportTwo.rpt")

    But if anyone can tell me how to set to NULL the parameters, feel free to share how.

    Thanks

    Rate People That Helped You
    Mark Thread Resolved When Resolved

  6. #6
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    Re: Crystal Report Add One Report Parameter = Missing Parameter Values

    Have you tried the HasValue() function that checks for values in Optional Parameters in the Crystal designer?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width