Parameters not being passed to stored proc

7 posts, 0 answers
  1. Andrew Diamon
    Andrew Diamon avatar
    5 posts
    Member since:
    Jun 2010

    Posted 20 Dec 2012 Link to this post

    Ever since I upgraded to the latest version of Reporting the SqlDataSource will not pass parameter values to my stored proc.  I'm using Silverlight.  It ALWAYS says procedure or function expects parameter...  Even if I hard code the value it will not pass it!

    It worked fine in the previous version.

    ObjectDataSource DOES pass parameters, but a stored proc will not work.
  2. Elian
    Admin
    Elian avatar
    435 posts

    Posted 27 Dec 2012 Link to this post

    Hi Andrew,

    We were not able to reproduce the problem with version 6.2.12.1123. Please give us some additional information on your scenario.
    • What version of Telerik Reporting are you using?
    • Does the SqlDataSource behave as expected in other viewers?
    • How do you pass the parameters to the SqlDataSource (with Report Parameters or not)? 
    Any information that you think could be relevant is appreciated.
    Additionally if it is possible to isolate the problem into a small sample project, you can open a support thread and attach it there along with the data-base. 

    Greetings,
    Elian
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  3. DevCraft banner
  4. Andrew Diamon
    Andrew Diamon avatar
    5 posts
    Member since:
    Jun 2010

    Posted 08 Jan 2013 Link to this post

    6.2.12.1017

    The control seems to think this is the latest version.  Where do I get 6.2.12.1123?
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 11 Jan 2013 Link to this post

    Hello Andrew,

    The Control Panel would only show official versions, while my colleague has tested with the latest internal build. You have to log-in to your client account and there you would be able to find and download internal builds.

    Anyway, we released Q3 SP1 2012 release yesterday, and we urge you to download it and upgrade. If the issue persists with it, try to isolate the problem into a small sample project which you can attach in an official support ticket.

    All the best,
    Steve
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  6. Igor
    Igor avatar
    13 posts
    Member since:
    Oct 2010

    Posted 13 Jan 2013 Link to this post

    Hi Steve,

    I upgraded my telerik reporting to Q3 2012.
    I am using telerik reporting for silverlight.
    Unfortunately report parameters are passed with null values now.

    Here are the code:

    Silverlight:
    private void reportViewer_RenderBegin(object sender, RenderBeginEventArgs args)
    {
        args.ParameterValues["ProjectID"] = (cbProjects.SelectedItem as Project).ProjectID; }








    Report:
    Constructor
    InitializeComponent();
    ReportParameters.Add("ProjectID"ReportParameterType.Integer, null);




    private void table1_NeedDataSource(object sender, EventArgs e)
    {
        var parameterCollection = ReportParameters;     var dataSet = ProjectHoursBLL.GetWorkedHoursByProjectID(Convert.ToInt32(parameterCollection["ProjectID"].Value.ToString()));
        (sender as Telerik.Reporting.Processing.Table).DataSource = dataSet; }


    For some reason parameterCollection["ProjectID"].Value returns null.
    I checked all dll references and they are all pointing to the Q3 2012 version.
    Reports that do not require parameters are working.
    Every report that require parameter is not working (parameter value is passed as null).

    Please help.

    Regards

    Igor
  7. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 16 Jan 2013 Link to this post

    Hello Igor, 
    The recommended approach to access the report parameters processing values in events is shown in the following code snippet:
    private void table1_NeedDataSource(object sender, EventArgs e)
    {
        var table= (sender as Telerik.Reporting.Processing.Table);
        var dataSet = ProjectHoursBLL.GetWorkedHoursByProjectID(Convert.ToInt32(table.Parameters["ProjectID"].Value.ToString()));
        table.DataSource = dataSet;
    }

    You may find useful the Using Report Parameters programmatically help article.

    Kind regards,
    Peter
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  8. Bob
    Bob avatar
    7 posts
    Member since:
    Sep 2012

    Posted 22 Jan 2013 Link to this post

    After updating to version 6.2.13.110 the following no longer works and only returnes Null values?

    string test = this.Report.ReportParameters[0].Value.ToString();


    As a result the NeedDataSource event also returns "Object reference not set to an instance of an object. We need the new verison because it corrects the issue of crashing the program when we print the report.
    Any ideas?

    Bobn


    Update - This worked. 
    Placed in the ItemDataBinding event. 
    Telerik.Reporting.Processing.Report rpt = (Telerik.Reporting.Processing.Report)sender;
            var obj = rpt.Parameters;
     
           Classes.Global.GlobalBillAssmnt= obj["ID"].Value.ToString();
           
     
           

     

Back to Top
DevCraft banner