cancel
Showing results for 
Search instead for 
Did you mean: 

Subreport Parameter Issue

Former Member
0 Kudos

I am having an issue trying to get my subreports to know what the value of the parameter is from the main report. I have a main report and 9 subreports all with the same parameter. The parameter information is being set correctly in the vb code for the main report, but this information is not being passed to the subreports.

I am using the Crystal Reports that is within Visual Studio 2008.

Does anyone have any ideas on how to resolve this issue.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Adam_Stone
Active Contributor
0 Kudos

My guess is that your subreports are not linked to the main reports parameter.

Former Member
0 Kudos

I believe that you may be right about the subreports not being linked to the main report. I have read a lot of places that this should be easy to do, but yet I can not seem to figure out how to do this. I have read that if I right click on the subreport it should be an option to change the subreport link, but anywhere I right click that is not an option.

I have tried right clicking on the name of the subreport at the bottom of the page. I have also tried right clicking on the report itself, also with no luck. Lastly, I have tried right clicking on every option in the Field Explorer, but I can not find any option that has to do with linking/unlinking/changing the link for a subreport.

Bhushan - when I go to where you suggested and find what I need (1214946 - How to pass a parameter from a main report to a subreport) the link with the resolution is not valid, it keeps giving me errors. Is there anywhere you can think of that I could find the answer to my issue?

Edited by: LeahMarie on Aug 5, 2010 1:09 PM

former_member183750
Active Contributor
0 Kudos

I would suggest posting your query to the [Crystal Reports Design|; forum. Get the report working as it should in the designer first, then try to work with the report in .NET.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Former Member
0 Kudos

I did as you recommended and posted my question in the Crystal Reports Design Forum. In the mean time I have temporarily put a work around in defining each of the individual parameters with each subreport name using the setparametervalue method asscoiated with ReportDocument.

When I try to run through it with this work around I get another issue ....

="This field name is not known. Error in File C:\DOCUME1\NAIDIT1\LOCALS~1\Temp\temp_7a83937c-ad1d-4eac-bcfc-621971a6975d {57B1CDD9-0BAE-41F2-BC68-58FAE44CA817}.rpt: Error in formula <Section_Visibility>. 'Count ({usp_GetMGFD_EZ_Data;1.MgfdId})=0' This field name is not known."

All the parameter values seem to be filling in correctly as I walk through the code, so the work around worked, I believe, but this other issue I am not sure what to do with.

I have changed all of the stored procedures to views and I do not and never did have a formula that was like this: 'Count ({usp_GetMGFD_EZ_Data;1.MgfdId})=0' There is a different formula error for each of the subreports that I have, but I am not sure what is causing them. I am not using usp_GetMGFD_EZ_Data or the Mgfdid anywhere in the report or in formulas for the report.

Can anyone help with this issue?

Answers (1)

Answers (1)

former_member188030
Active Contributor
0 Kudos

Hello,

Search and refer the sample code 'Passing parameter to a subreport' from here ;

[|]

Thanks,

Bhushan.