Wednesday 19 January 2011

Crystal Reports in Visual Studio 2010 Parameters Problem

I am banging my head off a brick wall.

I am working with Visual Studio 2010, creating a Crystal Report which is based on a stored procedure with 2 parameters. The report has 1 subreport with 3 parameters, 2 of which are the same as the main report (linked) and the other is based upon a field in the main report’s stored procedure (also used a subreport link here).

I can view the report in the preview window and it all works perfectly, prompting only for the main report’s 2 parameters.

In C#, I can get no further than “{missing parameter values}” when I try to run the report, Google yields lots of search results on this problem but the solutions don’t work and were generally posted in 2004ish for CR as a standalone product rather than something in Visual Studio.

I contacted SAP, they said it’s Microsoft I need to ask (buck nicely passed). I’m completely stuck and frustrated, if anyone knows the answer please tell me!

Any help much appreciated

Cheers


Current Code:

ParameterDiscreteValue ThisParameterValue = new ParameterDiscreteValue();
            ThisParameterValue.Value = ClientRef;
            ValuationReport.ParameterFields["@ClientRef"].CurrentValues.Add(ThisParameterValue);



UPDATE: You cannot use Crystal for VS2010 if you have VS2008 installed, they conflict with eachother. VS2010 Crysatral wont run aganst SQL2000 so I had no choice but to uninstall Crystal 2010, create the report in a 2008 class library, and then reference the library from my 2010 project.

This worked a treat.

No comments:

Post a Comment