<body style="overflow: hidden; position: static; margin: 0px; padding: 0px; width: 100%; height: 100%">
<div style="width:100%; height:100%; position:absolute;">
@(Html.EJ().ReportViewer("reportsample")
.ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Local)
.ReportServiceUrl(VirtualPathUtility.ToAbsolute("~/api/ReportApi"))
.ReportPath("~/App_Data/GroupingAggregate.rdlc")
.DataSources(ds => ds.Name("Sales").Value(ViewData["DataSource"]).Add())
)
</div>
@(Html.EJ().ScriptManager())
</body> |
public ActionResult RDLCReport()
{
List<Syncfusion.JavaScript.Models.ReportViewer.ReportDataSource> datasources = new List<Syncfusion.JavaScript.Models.ReportViewer.ReportDataSource>();
Syncfusion.JavaScript.Models.ReportViewer.ReportDataSource reportDatasource = new Syncfusion.JavaScript.Models.ReportViewer.ReportDataSource();
reportDatasource.Name = "Sales";
reportDatasource.Value = SalesDetails.GetData();
datasources.Add(reportDatasource);
ViewData["DataSource"] = datasources;
return View();
} |
<body style="overflow: hidden; position: static; margin: 0px; padding: 0px; width: 100%; height: 100%">
<div style="width:100%; height:100%; position:absolute;">
@(Html.EJ().ReportViewer("reportsample")
.ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Local)
.ReportServiceUrl(VirtualPathUtility.ToAbsolute("~/api/ReportApi"))
.ReportPath("~/App_Data/GroupingAggregate.rdlc")
.DataSources(ViewData["DataSource"] as List<Syncfusion.JavaScript.Models.ReportViewer.ReportDataSource>)
)
</div>
@(Html.EJ().ScriptManager())
</body> |
<script>
function onChange(args) {
var url = document.URL;
$("#container").ejReportViewer(
{
reportServiceUrl: url + 'api/ReportApi',
processingMode: ej.ReportViewer.ProcessingMode.Remote,
reportPath: '~/App_Data/' + args.selectedText
});
}
</script> |
public void OnReportLoaded(ReportViewerOptions reportOption)
{
reportOption.ReportModel.DataSources.Clear();
var reportName = reportOption.ReportModel.ReportPath;
if (reportName.Contains("Dependent.rdl"))
{
List<ReportParameter> parameters = new List<ReportParameter>();
parameters.Add(new ReportParameter() { Name = "ReportParameter1", Labels = new List<string>() { "Bikes" }, Values = new List<string>() { "1" } });
reportOption.ReportModel.Parameters = parameters;
}
else if (reportName.Contains("GroupingAggregate.rdlc"))
{
reportOption.ReportModel.ProcessingMode = ProcessingMode.Local;
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "Sales", Value = SalesDetails.GetData() });
}
} |
public void OnReportLoaded(ReportViewerOptions reportOption)
{
var datasets = ReportHelper.GetDataSources();
foreach (var item in datasets)
{
reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials(item.DataSourceName, "ssrs1", "RDLReport1"));
}
} |