cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter fields count issue

Former Member
0 Kudos

We've created our own viewer to hide a parameter (user name) and developed dynamic cascading prompts prior to Crystal having it build it and are in the middle of upgrading our viewer to VS2010 C# from VS2010 C++. We used ParameterFields.Count to loop through the parameters of the report, setting the user id, hiding it from the selection and building our selection values. We've since upgraded and ParameterFields.Count now also contains the subreport parameter which are always linked but still part of the count. All we want to do is loop through the main report parameters, check them against our ini file and build the screen as we were before. The addition of subreport paramters are causing a problem because generally we'll use the same parameter name between reports. Any ideas on how to check if the parameter in the count is in the main report or subreport or only loop through paramters defined in the main report. Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Our developer decided to use the following:

In the case of main-report parameters report name is either blank or null. So for each parameter we checked for this condition to obtain proper count.

var objParamCount = (from CrystalDecisions.Shared.ParameterField p in rptDoc.ParameterFields

     where string.IsNullOrEmpty(p.ReportName)

     select p).Count();

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos