This is a migrated thread and some comments may be shown as answers.

Passing Parameters from Telerik report(Q3 2014) to Stored Procedure

5 Answers 252 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kate
Top achievements
Rank 1
Kate asked on 31 Jul 2015, 07:17 PM

I've created a Telerik report and my datasource is pointing to a stored procedure in sql server.  However, when executing the report I get the following error:

Procedure or function '​ABC123' expects parameter '@CustomerLocationID', which was not supplied.​

When going through the "Configure" option for the datasource, the correct report parameters are mapped to the stored procedure parameters.

When testing the stored procedure call through the "Configure" option, the resultset is returned, as expected, but when running the report through the application, I get the above error.  See the attached images for parameter mapping.

 Thanks.

5 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 03 Aug 2015, 01:25 PM
Hello Kate,

Please check if you have Glimpse installed, as there is a known issue when using Glimpse and a Telerik Reporting SqlDataSource component with a stored procedure. The Telerik Reporting SqlDataSource component uses NET data providers installed on the machine. The stored procedure parameters will not be passed correctly if Glimpse is installed and modifies the default functionality of those data providers.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Accepted
Kate
Top achievements
Rank 1
answered on 04 Aug 2015, 07:52 PM

We figured out the issue. It was related to "Entity Framework Profiler".  To fix the issue I added the following code which disables the tool when not debugging.

if (HttpContext.Current.IsDebuggingEnabled)
            {
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize();
            }

0
Rick
Top achievements
Rank 2
answered on 29 Jan 2016, 08:01 PM

Is there any plan on Telerik's part to fix this problem? I'd hate to have to remove Glimpse because I'm using Telerik Reporting.

 

Rick

0
Stef
Telerik team
answered on 02 Feb 2016, 03:25 PM
Hi Rick,

In general, the EntityDatasource will try to create a context with the given provider and connection string 9and the associated ADO.NET classes). Then data will be retrieved through the data models' methods. Glimpse intersects the work of data providers, which leads to the error when stored procedures expect parameters.
There is an opened issue in github you can follow - Glimpse.ADO + Telerik.Reporting Issues #538.


Please check Data Source Components Problems - "An error has occurred while processing Report 'ReportName': Procedure or function 'StoredProcedureName' expects parameter '@ParameterName', which was not supplied." error on preview, and the suggested workarounds.


Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Accepted
Doug
Top achievements
Rank 1
Veteran
answered on 16 Nov 2016, 05:43 PM

Just spent a fair amount of time trying to track down SQL pararmeters passing into stand-alone trdp report.  Found the solution on page http://docs.telerik.com/reporting/troubleshooting-data-source-components-configurations#sqldatasource-component where:

 

Other reason for the error is the usage of Glimpse which prevents the proper execution of StoredProcedure commands. Glimpse can be removed or bypassed by using the 'Select Statement' option of the SqlDataSource Wizard as follows: "exec 'StoredProcedureName' @param1,@param2,..".

 

solved it for me.

Tags
General Discussions
Asked by
Kate
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Kate
Top achievements
Rank 1
Rick
Top achievements
Rank 2
Stef
Telerik team
Doug
Top achievements
Rank 1
Veteran
Share this question
or