How to pass a DateTime parameter from javascript

2 posts, 1 answers
  1. Ciaran
    Ciaran avatar
    6 posts
    Member since:
    Apr 2014

    Posted 20 May Link to this post


    I'm trying to pass a parameter to a Telerik report that is expecting a DateTime parameter from javascript. My code is this:

                    serviceUrl: "/api/reports/",
                    templateUrl: "/src/vendor/ReportViewer/templates/telerikReportViewerTemplate.html",
                    reportSource: {
                        report: "MyFullyQualified assembly name",
                        parameters: {
                            sessionId: "b57c7405-5d1d-4513-841c-4c7b2015d376",
                            otherId: "8e44c09d-771e-453c-83e9-1723faaed2fd",
                            periodEnd: "2015-06-30"

    As you can see the periodEnd is currently represented as a string in javascript. Looking at my Chrome dev tools, it looks like it's failing because the string containing the periodEnd is not being parsed as a .Net DateTime. I've also tried passing a javascript date object i.e. new Date("2015-06-30") with the same result.

    The exception message I'm getting is: "Missing or invalid parameter value. Please input valid data for all parameters."

    The Telerik API response to /api/reports/clients/2334-etc is as follows. You can see that the value for periodEnd is null even though I am specifying it.




    Any help is much appreciated,

    Ciaran O'Neill

  2. Answer
    Ciaran avatar
    6 posts
    Member since:
    Apr 2014

    Posted 22 May in reply to Ciaran Link to this post

    Issue resolved - it was do to with a misspelled parameter name, not DateTime parsing.
  3. DevCraft R3 2016 release webinar banner
Back to Top