views:

341

answers:

2

I have an issue that's pretty baffling:

  • Main report contains subreport
  • Subreport uses a stored proc with a parameter
  • In the subreport I've set a default value for that parameter
  • In the main report, I've created a Formula Field with the value I'd like to pass to the subreport, and thus, the stored procedure, and linked it to the subreport
  • When I run the report, everything runs fine
  • When I Verify Database, I get: "Procedure or function '[stored proc]' expects parameter '@[parameter]', which was not supplied"
  • When I change the Formula Field to a Parameter Field on the main report and set its default value and link to the subreport, everything works for both running the report and Verify Database

So What's the difference between passing a Formula Field to the subreport vs. passing a Parameter Field with a default value?

Thanks for any help you can give.

+1  A: 

I wouldn't worry about it. Crystal designer gets flaky with verify database when you start using SP and sub reports. Did you Verify Database from the main report or the sub-report? I think from the main report is most reliable. Also, I've never gotten default parameters to work well with SP. You could always create another SP that calls the original with a default value.

dotjoe
I did the Verify Database from both the subreport and the main report. it worked well in the subreport.I love the fact that, "Crystal designer gets flaky ... when you start using SP and sub reports." If you were to sum up Crystal, wouldn't subreports and data access be somewhere high up on the list? This one is so true, but makes me laugh.
Mark A Johnson
you'd think they would...lol...I've lost a small part of my life working with Crystal designer.
dotjoe
+1  A: 

The formula field is not evaluated until the report runs and reads in the records. The fact that Verify Database is seeing the stored procedure at all suggests to me you're connecting okay.

Michael Itzoe
Ah, this makes sense to me. However, when I run Verify Database, I'm entering the parameter values, which made me think that it's actually calling the stored proc on the db to do the verification. Is that not the case?
Mark A Johnson