Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using same parameter in Report and Subreport

Status
Not open for further replies.

StevenK

Programmer
Joined
Jan 5, 2001
Messages
1,294
Location
GB
I have a Crystal Report that contains a simplistic SubReport.
What I want to do is to be able to pass one parameter to the report and for it to be used in the standard body of the report and also within the Subreport (same parameter to be used in report and subreport).
How do I set about doing this ?
I'm working from a Delphi application that sets up the Crystal Report dynamically, passing the parameter(s) as required.
I need to pass just one parameter and for it to come into play twice.
Can this be done and how ?
Thanks in advance.
Steve
 
In case you are using the print engine API, you can use PEGetNParameterFields to get the number of parameters and then loop through all these parameters to get and set them (using PEGetNthParameterField and PEAddParameterCurrentValue respectively). This would set all parameters in both reports and subreports.

The same holds true for the RDC API as well. Just that you'd use the parameterfields collection in the reports and subreports objects.
I'd suggest see the legacy.chm file (if you r using print engine API) or the Crysta~1.chm file if you are using the RDC API. Just search on the function names mentioned above and you should get a Delphi example that'd help you.
 
With respect to my reply earlier I am assuming that you are not using subreport linkages.
 
Thanks for the feedback but I've actually mislead you. My apologies. :(
I'm not using Delphi in this instance (instinct took over while composing the post).
I'm actually using C# (within the Visual Studio .NET environment).
Can anyone enlighten me as to what I need to do through C# code ?
Thanks in advance.
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top