Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 10 .Net - Stored Proc report ignoring parameters

Status
Not open for further replies.

rcampbellwhite

Programmer
Apr 14, 2003
7
GB
I just upgraded from Crystal Reports.Net that shipped with Visual Studio 2003 to Crystal Reports.Net v10.0. I upgraded because of two known PDF rendering bugs that were preventing me from being able to roll my reports into production - string fields being inexplicably truncated in the report, and graphics being rendered incredibly poorly. Fortunately both of these issues were resolved by the upgrade and my reports were looking really good as a result.

However, I stumbled across a bit of a show-stopper in that one of my reports was suddenly ignoring the stored proc parameters that I was passing to it, thereby resulting in a report that always showed the same content.

My first stop was the Business Objects .Net Developer Zone. A bit of browsing turned up the How To page, which included a link to a knowledge base article published on 23 Feb 2004 entitled "Report not accepting new stored procedure parameters values in .NET application". This article suggested using the .Refresh method on the report document object at runtime. I tried it, but no joy.

I then thought I'd take it back to basics and see exactly what stored proc call was being fired at my SQL Server by the report. Using SQL Profiler I saw that the report was passing the same value for one parameter regardless of what I was specifying it should pass via my front-end application. This made me wonder about default values in the report, and therein lay the answer to my problem. The report had saved default values included in its definition. These were overriding my passed parameter values. As soon as I deleted the default values and recompiled my application it all started working properly again.

Not really desirable behaviour, but at least my reports are working again now!

I hope this helps someone avoid the same amount of frustration that my Friday morning has just consisted of!

Rob C-W
 
Hi, at least somebody else have the same problem I am facing! Unfortunatelly, my report parameter does not have default value, so your solution didn't solve my problem.
I do pass changed parameter value ( confirmed by trace="True"), but RAS in .NET ignores it...if url is the same. If I append that changed value in query string, it executes fine; if I change it in code it does not accept it...
I've tried:
rcDoc.RefreshReportDocument(); (as per knowledge base article you mentioned) where rcDoc is my CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument
but no joy...
Any ideas?

Thanks!
Lady Linet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top