reportSource not being refreshed as expected

3 posts, 0 answers
  1. Eduardo
    Eduardo avatar
    3 posts
    Member since:
    Aug 2014

    Posted 13 May 2015 Link to this post

    I have been working on this for a while and it simply doesn't work.  I set my reportSource as follows (as specified in the TR-Q1 2015 documentation):

    self.loadViewer = function () {
    $('#reportWrapper').telerik_ReportViewer({
        reportSource: self.reportSource(),
        serviceUrl: self.reportSettings.serviceUrl,
        templateUrl: self.reportSettings.templateUrl,
        viewMode: self.reportSettings.viewMode,
        scaleMode: self.reportSettings.scaleMode,
        scale: self.reportSettings.scale,
        ready: function () {
            self.reportViewer = this;
        }
    });
    };

    self.refreshReport = function () {
        if (self.reportViewer) {
           self.reportViewer.reportSource(self.reportSource());
           self.reportViewer.refreshReport();
        }
    }

    self.compositionComplete = function () {
        self.loadViewer();
        self.refreshReport();
    };

    I have tried to set the reportSource in different ways still I see that the viewer is not passing the correct params but those used while in design.  Can you please provide an example that works for MVVM (I am using Durandal). 

    Eduardo. 

     

     

     

     

  2. Eduardo
    Eduardo avatar
    3 posts
    Member since:
    Aug 2014

    Posted 13 May 2015 in reply to Eduardo Link to this post

    My recent test looks like:

    self.refreshReport = function () {
    var viewer = $('#reportWrapper').data('telerik_ReportViewer');
    if (viewer) {
    var source = self.reportSource();
    viewer.reportSource({
        report: source.report,
        parameters: {
                      CustomerId: self.customerId,
                      OptionNo: '0'
        }
    });
    viewer.refreshReport();
    }
    }

    Any idea what is wrong?

     

  3. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 18 May 2015 Link to this post

    Hi Eduardo,

    The attached demo project illustrates a simplified usage of MVVM and the HTML5 Report Viewer.

    Please use the browser's console or Fiddler to trace the sent requests, their URLs, content and response statuses. If you use Fiddler, this information will be listed in Fiddler - Inspectors - Request/Response - Raw tabs.

    Through the browser's console you can debug what values are passed on creating and refreshing the viewer's object.

    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
Back to Top