hello all.
I have one project for showing dashboard in mvc and need to refresh html viewer after drop down list changed.
how can i Do this in controller or view?
this is my index view:
@Scripts.Render("~/bundles/jquery")
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"> </script>
@using Stimulsoft.Report.Mvc;
@{
ViewData["Title"] = "Index";
}
<h2>Show Dashboard in the Viewer</h2>
<script src="https://ajax.googleapis.com/ajax/libs/j ... "></script>
<select id="maptype" onchange="maptypePostback()" title="">
<option value="1">Individual</option>
<option value="2">Group</option>
<option value="3">Heatmap</option>
<option value="4">HeatmapWithGroup</option>
</select>
<input type="submit" value="Submit" />
@Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
Actions =
{
GetReport = "GetReport2",
ViewerEvent = "ViewerEvent",
//PreviewReport = "PreviewReport",
//SaveReport = "SaveReport",
//DesignerEvent = "DesignerEvent"
//DesignReport = "DesignReport"
}
})
@Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
Actions =
{
GetReport = "GetReport1",
ViewerEvent = "ViewerEvent",
//PreviewReport = "PreviewReport",
//SaveReport = "SaveReport",
//DesignerEvent = "DesignerEvent"
//DesignReport = "DesignReport"
}
})
@*<script>
function maptypePostback()
{
$('#maptype').on('change', function () {
var ID = $('#maptype').val();
});
$('#maptype').submit();
}
</script>*@
<script>
function maptypePostback() {
debugger;
$.ajax({
url: '@Url.Action("GetReport2", "Viewer")',
type: 'POST',
data: { type: $('#maptype').val() },
success: function () {
@*$.ajax({
url: '@Url.Action("ViewerEvent", "Viewer")',
type: 'POST',
success: function () {
},
error: function (e) {
console.log(e)
alert("error");
}
});*@
},
error: function (e) {
console.log(e)
alert("error");
}
});
return false;
}
</script>
this is my viewer controller:
public ActionResult GetReport1()
{
// Create the dashboard object
var report1 = StiReport.CreateNewDashboard();
// Load dashboard template
report1.Load(Server.MapPath("~/Dashboards/Report1.mrt"));
// Return template to the Viewer
return StiMvcViewer.GetReportResult(report1);
}
public ActionResult GetReport2(short? type=1)
{
var returnreport = StiReport.CreateNewDashboard();
switch (type)
{
// Load report snapshot
case 1:
{
// Load dashboard template
returnreport.Load(Server.MapPath("~/Dashboards/MapWithParameter2.mrt"));
break;
}
// Load report template
case 4:
{
// Load dashboard template
returnreport.Load(Server.MapPath("~/Dashboards/MapWithParameter.mrt"));
break;
}
}
// Return template to the Viewer
return StiMvcViewer.GetReportResult(returnreport);
}
public ActionResult ViewerEvent()
{
return StiMvcViewer.ViewerEventResult();
}
need to refresh html viewer
Re: need to refresh html viewer
I also need that after change drop down list value MapWithParameter is shown in viewer.
thanks.
thanks.
Re: need to refresh html viewer
Hello
Please, send us this project to support@stimulsfot.com.
We need to reproduce the issue to help you.
Thank you.
Please, send us this project to support@stimulsfot.com.
We need to reproduce the issue to help you.
Thank you.
-
- Posts: 6265
- Joined: Tue Mar 20, 2018 5:34 am
Re: need to refresh html viewer
Hello,
You can call submit button action.
//where jsStiWebViewer1 - "js" + Viewer ID
jsStiWebViewer1.postAction("Submit");
Thank you.
You can call submit button action.
//where jsStiWebViewer1 - "js" + Viewer ID
jsStiWebViewer1.postAction("Submit");
Thank you.
Re: need to refresh html viewer
thanks mr Lech Kulikowski for your reply.
my viewer refreshed by this code.
now I have another problem with showing my dashboard named MapWithParameter when the selected value for drop down list is changed,viewer shows dashboard named MapWithParameter2 again.
what is the problem in my code?
my viewer refreshed by this code.
now I have another problem with showing my dashboard named MapWithParameter when the selected value for drop down list is changed,viewer shows dashboard named MapWithParameter2 again.
what is the problem in my code?
Re: need to refresh html viewer
Hello
Please, send us this project to support@stimulsfot.com.
We need to reproduce the issue to help you.
Thank you.
Please, send us this project to support@stimulsfot.com.
We need to reproduce the issue to help you.
Thank you.