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

6 posts, 2 answers
  1. Kate
    Kate avatar
    2 posts
    Member since:
    Jun 2012

    Posted 31 Jul 2015 Link to this post

    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.

  2. Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 03 Aug 2015 Link to this post

    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 the .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
  3. DevCraft banner
  4. Answer
    Kate
    Kate avatar
    2 posts
    Member since:
    Jun 2012

    Posted 04 Aug 2015 Link to this post

    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();
                }

  5. Rick
    Rick avatar
    17 posts
    Member since:
    Sep 2011

    Posted 29 Jan in reply to Nasko Link to this post

    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

  6. Stef
    Admin
    Stef avatar
    3044 posts

    Posted 02 Feb Link to this post

    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
  7. Answer
    Doug
    Doug avatar
    22 posts
    Member since:
    Feb 2005

    Posted 16 Nov Link to this post

    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.

Back to Top
DevCraft banner