This is a migrated thread and some comments may be shown as answers.

reportSource not being refreshed as expected

2 Answers 157 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eduardo
Top achievements
Rank 1
Eduardo asked on 13 May 2015, 01:11 PM

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 Answers, 1 is accepted

Sort by
0
Eduardo
Top achievements
Rank 1
answered on 13 May 2015, 06:40 PM

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?

 

0
Stef
Telerik team
answered on 18 May 2015, 11:39 AM
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
Tags
General Discussions
Asked by
Eduardo
Top achievements
Rank 1
Answers by
Eduardo
Top achievements
Rank 1
Stef
Telerik team
Share this question
or