@using Syncfusion.JavaScript
@{
ViewData["Title"] = "Syncfusion ReportViewer control";
}
<select id="dropdown1">
<option value="GroupingAgg">GroupingAgg</option>
<option value="Sales Order Detail">Sales Order Detail</option>
</select>
<div style="align-items:flex-start; height:100px;width:100px">
<ej-drop-down-list id="dropdown1" selected-item-index="0" change="onChange"></ej-drop-down-list>
</div>
<div style=" align-items:center; height:525px;width: 100%;">
<ej-report-viewer id="reportviewer1" report-service-url="../Home" report-path="/ReportsTemplate/GroupingAgg.rdl"processing-mode="Remote" />
</div>
<script type="text/javascript">
function onChange(args) {
reportpath = "/ReportsTemplate/" + args.selectedValue + ".rdl";
var reportObject = $("#reportviewer1").data("ejReportViewer");
reportObject.setModel({
reportPath: reportpath
});
}
</script>
<ej-script-manager></ej-script-manager> |
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
string basePath = _hostingEnvironment.WebRootPath;
FileStream inputStream = new FileStream(basePath + reportOption.ReportModel.ReportPath, FileMode.Open, FileAccess.Read);
reportOption.ReportModel.Stream = inputStream;
} |