Advertisement

10.31.2007 at 09:20PM PDT, ID: 22931590
[x]
Attachment Details

Crystal Reports vs2005 stored proc parameter is missing (the parameters are passed to crystal OK but crystal isn't passing them to the stored proc)

Asked by Wikkard in Crystal Reports Software, MS SQL Server, Visual Studio .NET 2005

Tags: crystal, report, parameter, stored

I have a crystal report which calls a stored proc with a number of parameters.
There are a number of dropdowns that the users can pick the parameters from.
When the report is refreshed the values of the dropdowns are then loaded into the reportDocument via the reportDocument.SetParameterValue method AND into the reportViewers ParameterFields collection thru a convoluted method using parameterFields and DiscreteFieldValue objects.
(If I only set the parameters in one place I got annoying missing parameter message, so not I set them in both the reportViewer and the reportDocument.)

Now the problem is that crystal is calling the SP twice, once with the wrong number of parameters. From SQL profiler:

exec "HUBB_OPS_01"."dbo"."cmsReportEventSalesSel";1 NULL, NULL, NULL, '', NULL

There should be 6 parameters not 5. The CR engine calls the SP again straight away with the right parameters

exec "HUBB_OPS_01"."dbo"."cmsReportEventSalesSel";1 NULL, NULL, NULL, NULL, '', NULL

Now the problem is that when I try to set the 5th varchar parameter crystal make the following call to the DB :
exec "HUBB_OPS_01"."dbo"."cmsReportEventSalesSel";1 NULL, NULL, NULL, 'United States', NULL

This call crashes the report page because 'United States' cannot be converted to int (the 4th parameter).  I have a feeling that if this didnt cause an error crystal would call the sp again with the correct parameters.


Any ideas ? This is a stupid CR bug, one of the many thousands! I should have saved myself the trouble and written the reports by hand, however they are 95% complete and it seems a shame to throw it away because of something dumb like this.
Start Free Trial
[+][-]10.31.2007 at 09:39PM PDT, ID: 20190860

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.31.2007 at 09:59PM PDT, ID: 20190896

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.01.2007 at 03:17AM PDT, ID: 20191665

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Crystal Reports Software, MS SQL Server, Visual Studio .NET 2005
Tags: crystal, report, parameter, stored
Sign Up Now!
Solution Provided By: dosth
Participating Experts: 3
Solution Grade: A
 
 
[+][-]11.01.2007 at 06:01AM PDT, ID: 20192387

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.01.2007 at 06:02AM PDT, ID: 20192398

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.01.2007 at 03:19PM PDT, ID: 20197117

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.01.2007 at 04:53PM PDT, ID: 20197525

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906