Click here to Skip to main content
15,891,689 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
hi to all
i have a subreport in my main report and it has one storeProcedure as datasource that has one sp Parameter like "MyParameter".

i want to get this parameters by c# code ,how can i do this?

in main report we can get paramters using below code but it falling to problem when
we want to use this code for subreport !!!!!!!

C#
ReportDocument reportDocument;
 reportDocument.Load(pageObject.Server.MapPath(mainreportFilename));

foreach (CrystalDecisions.Shared.ParameterField field in reportDocument.ParameterFields)
//some code 


thanks for any help.
Posted

In main report
reportDocument.ParameterFields
you can find parameter fields of its sub reports too.
 
Share this answer
 
Comments
mhd.sbt 15-May-14 12:00pm    
ok thanks for your answer,is there a way that distinguish main report parameter from sub report parameter?
how to know which parameter is for main report and which is sub report.
thanks for your time.
reportDocument.ParameterFields[0].ReportName


will give the sub report name
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900