GSQL
I created the parameter in the subreport. See attached image. And, I selected the PolicyId field in the sub-report...
Main Topics
Browse All TopicsI have an existing reports and every thing works fine.
Now, for the header I have created a sub-report and this sub-report is tied to a stored procedure.
I am passing the PolicyId to the sub-report as a linked param.
When I preview (in design mode) the sub-report with the desired PolicyId everything works ok.
BUT, when I run the main report then I keep getting the "Missing Parameter Value." error message.
I have "Verified the database" so every thing is in sych.
any help would be much appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I also went the route of tying the subreport to a strongly typed dataset "ReportHeader.xsd".
Again, the whole sub-report gets pulled up in the Group header section. It should pull up only a single record based on the the PolicyId.
Please see inserted snapshot on how I have linked the main report to the sub-report...
Am I missing some thing ? Any help would be much appreciated.
Have you installed SP3? I assume you can install it with the VS version of Crystal Reports.
Check out this information from the CRXIWIN_SP3 description of a subreport parameter issue:
ADAPT00584330
Patch ID: 38,600,347
Description:
A record selection formula applied to subreports in a .NET application may fail to filter the records for all subreports.
The cause of the problem is that the modifying parameters for the record selection formula are lost before the report is run; a memory
clean-up routine removes all modifying parameters for the record selection formula instead of removing only those not in use.
New Behavior:
This problem is resolved.
To solve the problem, requests for record filter modifications are removed only if they come from the same
subreport or from the main report.
The issue is corrected in the following component version, or later.
dtsagent.dll 10.2.0.1409 06/09/2006
I'm now sure where the DLL would be in your case, but you could check
C:\Program Files\Business Objects\Common\3.5\bin
If your version is greater than 10.2.0.1409 there still something else going on.
10.2.0.1093 is the version that I have. And it resides @ C:\Program Files\Business Objects\Common\2.7\bin.
I'm at the client site and have inherited this development environment.
Are you sure that this could possibly be causing the problem. Are there any other workarounds short of installing the patch.
Asking the client to install this patch on all the dev boxes, staging and production servers for this one functionality may not be feasible...
thanks for the help
That's understandable. Since their file version is less than 10.2.0.1409 this fix may not apply.
Since it works in the designer and not at runtime it seems like it may be an issue with the code.
Your first screenshot shows CrystalReports2.rpt in the main report, but your code snippet refers to CrystalReports3.rpt. I assume you've continue to test and created a new subreport?
The link that you show is to a parameter that CR created in the subreport, which it then compares with the data coming from the stored procedure. If the stored procedure used by the subreport has a PolicyId parameter, you need to link to that parameter. If that parameter is the same data type as the PolicyId field in the main report, the parameter should show up in the dropdown list under "Subreport parameter field to use".
If there are any other parameters in the subreport, you need to have something linked to them as well.
Once that's done, you should be able to run the report in CR and not get prompted for parameters in the subreport. However, if you're running the report from another application, you may still have problems. I'm not sure, because I don't run reports that way, but I think when run from other applications, there may be more involved than how the subreport is linked in the report.
James
GSQL: That is correct. Earlier with CrystalReports2 I had tied it to a stored proc. But with CrystalReports3 it is tied to a datatable.
So, with CrystalReports2 the error I was getting was "Missing Parameter Value".
With CrystalReports3 everything is displayed in the header section rather than just one record based on PolicyId...
James0628: Please see my comment above to GSQL. All the reports/subreports are in the same application and are in fact even in the same directory...
oRpt points to the main report.
When I run the main report then all the records from the CrystalReport3 sub-report are displayed. I have linked the report as per the image attached.
Also, CrystalReports3 is the sub-report and that gets populated with a data table. the code is given below. As you can see the dataset is called ReportHeader and within that I am linking to policyid. The t1 datatable I am manually populating/mocking the data and the code snippet is also shown below in image.
image2 shows how all the records are being displayed in the header. As you can see only record which has policyId 35 should be getting shown.
any help would be much appreciated. I am not quite sure if I am missing any step. thanks for all the help.
So, the subreport is actually reading tables directly, not using a stored procedure as indicated in your original message? In that case I can only guess that it may be something in the code that runs the report, but I don't run reports that way, so I can't help there. Hopefully someone else will come up with something.
James
James0628:
The subreport is not directly using stored procedures. The db layer returns either strongly typed object collections or datasets to the business tier. The business tier then applies business rules and then passes the datasets/collections to the code behind.
In this case a dataset is being returned and then the dataset.datatable is then being consumed by the subreport using the setdatasource syntax.
In the original post I was simply trying to get the subreport to work and then I was getting the "Missing param..." message.
Also, using stored procedure to directly populate the subreport may not be feasible when I have to move from dev, to staging, to Production considering the connection string is encrypted etc. Besides, that is not an option I have since this is an existing enterprise system and all other reports are using datasets.datatables.
thanks
James0628:
Just wanted to clarify that I am *not* using db tables directly. I am using dataset.datatables in the codebehind...
{James, I just re-read your post and realised that you may be thinking that I was using the the db tables directly but as mentioned above I am using dataset.datatables...}
thanks for the help
mlmcc:
Please see my post ID 25396517 onwards. Essentially, I am trying to get the report header such that only one record is displayed based on policyid.
However, as you can see in post ID: 25403450 all the records are being displayed in the header.
post ID: 25403450 also shows how I am linking the main report to the sub-report crystalreports3
Please let me know if I can give any further information. Thank you again for your help
sanagarwl
mlmcc,
I have linked the policyid from the main report to the sub-report as per post id: 25403450 {untitled3.bmp}
In the code behind I set the sub report with the following syntax.
oRpt.Subreports("CrystalRe
I assumed based on the code above the CrystalReport3 will pull up only the record that matches the policyid being passed in from the main report.
thanks for the help - {my apologies for not reponding earlier - I did not rcve an email stating that a comment had been added to my question...}
mlmcc:
once i linked the main report to the subreport - cystalreport3 as per post id 25403450, I went back to the cystalreport3 and here I do not "see" the record selection formula. Should this not be prepopulated with the correct formula.
When I do select the record selection formula what I see is shown in the attached image.
Could you let me know the syntax what needs to be in the record selection formula.
thanks again for all the help.
thanks mlmcc for all the help.
finally, finally i got this to work - here are the steps
1)specify a parameter field in the subreport as Pm-GetBondView.PolicyId
2)In the record selection formula in the subreport specify condition:{PolicyMod.Polic
3)In the main report link as per following image. {notice that select data in subreport... checkbox is disabled}
If one omits step 1 and 2 then the select data in subreport... checkbox *is* enabled BUT then all the records in the subreport are displayed.
It seems steps 1 and 2 have to be manually configured since the link "wizard" in the main report does not do the complete job.
and, voila everything start working...
mlmcc,
I think the difference is that he actually created a parameter in the subreport named Pm-GetBondView.PolicyId and linked the field to that parameter, rather than letting CR create the parameter and then linking that to a field in the subreport. When you link to a manually created parameter, the "Select data ..." option is not available. If you look at one of his previous screenshots, the "Select data ..." option was available before and he was using it.
sanagarwl,
It looks like in your version of CR, letting it create the parameter in the subreport and then trying to link that to a field in the subreport did not work. Or, it's possible that there's just something weird going on with that one report. Every now and then a particular report will just develop some odd problem where something that should work just doesn't seem to work quite right. Subreport links are one of the things that I think I've had problems with before, where for some reason one subreport just doesn't seem to want to work properly. This could be something like that.
FWIW, if I'm correct and you actually created a parameter named Pm-GetBondView.PolicyId, you might want to consider changing the name. When CR creates a parameter in a subreport, it starts the name with "Pm-". It might be worthwhile to rename your parameter and at least remove that part, to avoid possible confusion later (like how mlmcc seems to have assumed that CR created that parameter).
James
No problem.
FWIW, it's not unreasonable to start your parameter names with something specific that clearly identifies them as parameters. I don't, but others may. Personally, I find the "?" at the beginning of the name to be enough. But if you want to start your parameter names with something, I'd use something else, since CR uses "Pm-" for the subreport parameters that it creates.
James
Business Accounts
Answer for Membership
by: GSQLPosted on 2009-09-22 at 10:11:37ID: 25395081
Did you create the parameter in the subreport or did Crystal create it for you when you selected the subreport parameter? I believe you should see the "Select data in subreport based on field:" checkbox not grayed out and you should select the PolicyId field in the subreport dataset to link to.