Menu
Refresh a report without refreshing the page
Last Post 4/22/2015 2:29 PM by Deleted User. 1 Replies.
Sort:
PrevPrev NextNext
Author Messages
Deleted User
New Member
New Member
Posts:62


--
4/22/2015 2:25 PM  Quote  Reply  
I had a page with multiple modules on it and one was a report that I wanted to refresh without refreshing the entire page. I was able to accomplish this by setting up a button with some javascript.

The html looks like this:

<button onclick="$('#dnn_ctr1571_ViewReports_Visualizer_grdResults').load(document.URL + ' #dnn_ctr1571_ViewReports_Visualizer_grdResults');return false; ">Refresh Report</button>

Get the ID of the div for the report you want to refresh by viewing the page source.

-For Reports using HTML template, look for dnn_ctrXXXX_ViewReports_Visualizer_pnlContent (XXXX is the ModuleID)

-If your Reports module is using the basic gridview output, it will be dnn_ctrXXXX_ViewReports_Visualizer_grdResults
Deleted User
New Member
New Member
Posts:62


--
4/22/2015 2:29 PM  Quote  Reply  
Michael Pratt developed the following code to have the report refresh on a time interval instead. His directions for doing so follow here:

This is placed in the PAGE HEADER OF THE PAGE THAT HAS THE REPORTS MODULE.

You must first find the module ID using by viewing the page source.
For Reports using HTML template, look for dnn_ctrXXXX_ViewReports_Visualizer_pnlContent (XXXX is the ModuleID)
If your Reports module is using the basic gridview output, it will be dnn_ctrXXXX_ViewReports_Visualizer_grdResults

--------------------------------------------------------------------------------------------------------------
Code for Page Header When using the HTML template option in reports(5000 indicates a refresh every 5 seconds)


<script langauge="javascript">
window.setInterval("refreshDiv()", 5000);
function refreshDiv(){
$('#dnn_ctr455_ViewReports_Visualizer_pnlContent').load(document.URL + ' #dnn_ctr455_ViewReports_Visualizer_pnlContent');
}
</script>


--------------------------------------------------------------------------------------------------------------

Code for Page Header When using the Gridview option in reports


<script langauge="javascript">
window.setInterval("refreshDiv()", 5000);
function refreshDiv(){
$('#dnn_ctr1308_ViewReports_Visualizer_grdResults').load(document.URL + ' #dnn_ctr1308_ViewReports_Visualizer_grdResults');
}
</script>

Add Reply

Quick Reply
toggle
Username:
Subject:
Body:
Security Code:
CAPTCHA image
Enter the code shown above in the box below.