PDA

Click to See Complete Forum and Search --> : [RESOLVED] Remove Prompt for Subreport Parameter


calvin-c
Oct 2nd, 2008, 01:05 PM
I know this sounds similar to a thread posted earlier, but the problem is different. In this case the subreport parameters are linked to fields in records selected by the main report. The report is designed in CR XI but run via a VB.Net program.

The problem is, the VB program checks the report for parameters, then loads the proper value per the parameter name. (We have a list of standard parameter names developers are supposed to use.) This report should take no parameters-and when we run it manually, it doesn't.

But when VB checks the report, it says it has 3 parameters which all come from the subreport. Naturally these aren't in our list of standard parameter names, nor should they be since the VB program shouldn't be supplying the parameter values anyway.

I see two possibilities: one is to stop the report from telling the VB program about the subreport parameters. (No reason why it should as it gets the values from the main report anyway, but it does & that's the problem.)

The other is to identify the parameters as coming from the subreport & ignore them. I *could* do this by adding the specific parameter names to our list, but I'd prefer a more generic method since we have not told developers they need to use names from our list in subreport parameters. We have no idea how wide-spread this problem could be as it turned up in a new version of the VB program.

Any ideas? Thanks.

SergoT
Oct 3rd, 2008, 10:41 AM
Hi,

You can try this solution it worked for me.

I am using Visual Studio 2005 and CR10 also installed on my system. But I am using Visual Studio do design all reports and ReportDocument class to display report on CR Viewer.

Since you are using CR XI not sure if this you could use this patch.

http://www.businessobjects.com/global/doc/dev_zone/tutorial_samplecode_projects.zip

Also there is a link to other forum that might be helpful:

http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/0eb90aba-b6b3-44de-baeb-b18dac036ca8/#page:1

Hope this helps.

calvin-c
Oct 3rd, 2008, 04:23 PM
Thanks. At a quick look the thread in the other forum might have my answer. But it's got quite a bit of info to digest before I'm certain.

In the meantime a co-worker suggested simply bypassing any parameters for which the program can't set the values. I was apparently being too anal in my code. I assumed all parameters need a value so, if I couldn't identify the parameter then I didn't try to run the report.

With my co-worker's solution, if the problem is with the subreport parameters the report still runs fine-and if it doesn't run fine then I'll report the problem & don't really care whether it's with the subreport or main report parameters.

But thanks for the help-I still want to know how to identify which parameters come from the subreport & which from the main report so I appreciate the links, but it's no longer critical so I'm marking this solved. Thanks.

brucevde
Oct 3rd, 2008, 04:35 PM
But thanks for the help-I still want to know how to identify which parameters come from the subreport & which from the main report

The ParameterFieldDefinition class has an IsLinked method which returns
True if the parameter links a main report to a subreport.
False if the parameter does not link a main report to a subreport. .