HTML5 viewer passing parameters

8 posts, 1 answers
  1. Stephen
    Stephen avatar
    7 posts
    Member since:
    Aug 2012

    Posted 30 Oct 2013 Link to this post

    I'm having difficulty passing parameters to my reports using the MVC helper. The viewer loads the report correctly, but I'm not sure why it wont accept my passed values. I have an int and string to pass, I'm currently trying:

    @{
        var report = new UriReportSource() { Uri = "Report.trdx" };
        report.Parameters.Add(new Telerik.Reporting.Parameter("UserId", Model.UserId));
        report.Parameters.Add(new Telerik.Reporting.Parameter("UserName", Model.UserName));
    }

    @(Html.TelerikReporting().ReportViewer()
               .Id("reportViewer1")
               .ServiceUrl("/api/reports/")
               .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html")
                   .ReportSource(report)
               .ViewMode(ViewModes.INTERACTIVE)
               .ScaleMode(ScaleModes.SPECIFIC)
               .Scale(1.0)
               .PersistSession(true)
            )

    This is my first attempt as using the standalone designer, but I setup my parameters in the same fashion as previous reports. I keep getting "not all parameters have valid values". Attached an image with my current parameter setup.
  2. Squall
    Squall avatar
    174 posts
    Member since:
    Feb 2011

    Posted 01 Nov 2013 Link to this post

    Hi, Make sure that the Model properties are available. Try to with static values instead of the model.
    SN
  3. DevCraft banner
  4. Stephen
    Stephen avatar
    7 posts
    Member since:
    Aug 2012

    Posted 01 Nov 2013 Link to this post

    Thanks for the reply. I'm really needing this to work. I tried it with static values as you mentioned, but I still get the same result. The UriReportSource does seem to load correctly, when I'm in debug mode I can see the object with the json forming correctly in the parameters. I'm thinking the problem is with the trdx report, or perhaps the serviceurl, which I honestly don't understand completely yet. I have the report setup the same way I did in the internal project, so I'm not sure what I'm missing. I wanted to try and use the internal report to compare, but I can't find any examples of using the helper with an internally built report.
  5. Answer
    Stef
    Admin
    Stef avatar
    3050 posts

    Posted 06 Nov 2013 Link to this post

    Hello Stephen,

    If all parameters were set, most probably the problem lies in the Newtonsoft.Json.dll. Your problematic project most probably references the GAC version of Newtonsoft. In order to fix check if Newtonsoft is still installed in the GAC and remove it if so. For a quick fix just delete the Newtonsoft reference from your project and add it using nuget.

    Let us know if you need any further help.

    Regards,
    Stef
    Telerik

    New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

  6. Stephen
    Stephen avatar
    7 posts
    Member since:
    Aug 2012

    Posted 06 Nov 2013 Link to this post

    That did work, thanks for the help.
  7. Yan
    Yan avatar
    7 posts
    Member since:
    Mar 2011

    Posted 23 May 2014 Link to this post

    Hi, I have a same trouble, but update json lib isn't working for me.
    after receipt request, my parameters equals null.
    but I see data in my parameters in http request.
    I send string parameters to avoid problems.
    please help me :) I am use Mvc report viewer, and asp.net mvc project on serer side.
  8. Yan
    Yan avatar
    7 posts
    Member since:
    Mar 2011

    Posted 23 May 2014 Link to this post

    I have a same trouble, but update json lib isn't working for me.
    after receipt request, my parameters equals null.
    but I see data in my parameters in http request.
    I send string parameters to avoid problems.
    please help me :)I am use Mvc report viewer, and asp.net mvc project on serer side.
  9. Stef
    Admin
    Stef avatar
    3050 posts

    Posted 27 May 2014 Link to this post

    Hi Yan,

    Please test to set the persistSession option to false, to cease the preserving of the report between requests. Then verify that Newtonsoft.Json.dll is not installed in the machine's GAC, and update its reference to the latest available through Nuget.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner