|
-
Nov 13th, 2015, 01:06 PM
#1
Thread Starter
Frenzied Member
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:
Rel.Load(Server.MapPath("~/Reports/MyReport.rpt"), CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy)
Rel.SetParameterValue("@ID", id)
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
-
Nov 13th, 2015, 01:16 PM
#2
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
-
Nov 13th, 2015, 02:17 PM
#3
Thread Starter
Frenzied Member
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
-
Nov 14th, 2015, 04:35 PM
#4
Thread Starter
Frenzied Member
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
-
Nov 14th, 2015, 04:53 PM
#5
Thread Starter
Frenzied Member
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:
'Set the subreports vars Rel.SetParameterValue("@IDPEs", "0", "SubReportOne.rpt") 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
-
Nov 19th, 2015, 05:23 PM
#6
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|