Thank you, that helps...
In the Main SetLogon code in my test app you can add this to set the parameter form the main report:
// this is where you set the main report parameter values
// if the subreport is not linked by the record selection formula it returns the first value, or last value depending on the subreport link
// so in this case where the subreport is linked via the record selection formula the value needs to be passed to the subreport Link.
subreportLinkValue = 0;
SetCrystalParam(rpt, "@ID", subreportLinkValue.ToString());
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectioninfo;
No go down the code where I set the log on info for the subreports and add this:
// Log on and Get subreport SQl
SubreportController subreportController = rptClientDoc.SubreportController;
SubreportClientDocument subreportClientDocument = subreportController.GetSubreport(crSubreportObject.SubreportName);
// now set the subreport parameter - need to do this for each one.
SetSubCrystalParam(subreportClientDocument, "ID", "1");
That sets only the one subreport that uses the ID field. What you need to do is add code to test for the Subreport by name and then get the parameter collection and set the value accordingly.
I don't know what or how you want to set the subreport parameter values but the code to do so is in my test app, you just need to figure out where and how to...
If I don't set any of them then I get prompted for all 4:
It's the secondary subreport links that are causing it to prompt.
Don
