I am new to telerik reporting and want to create dynamic report using it. I browse through telerik official site but most of example given there are in Asp.Net not for Asp.Net MVC, So my question is how to create dynamic report using telerik reporting in Asp.Net MVC. Is any one done this before? I try to create simple report using SqlDataSource and created report template(.trdx file). I used following code to render my report in view
@{
var DataSource = new UriReportSource() { Uri = "MyReportTemplate.trdx" };
}
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl("/api/reports/")
.TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html")
.ReportSource(DataSource)
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(false)
)
but issue with is approach is that my all DB connection info is get stored in MyReportTemplate.trdx template so I want to create report design and store it into template file and dynamically generate data and bind it to template to generate report. By doing this my template(.trdx file) only contain designing part and I bind data to it by passing to it from controller. Is it possible to do that?
Thanks in advance...
Your question is very broad, but hopefully the following can point you in the right direction.
First of all the Telerik Reporting documentation is good enough to show you how to get their reports working with ASP.NET MVC. Their documentation isn't all that well laid out but it is pretty comprehensive.
You can find the documentation relating to creating the client side report viewer at the following: HTML5 Report Viewer - The ASP.NET MVC Extension section is particularly important.
You can then also find the documentation relating to how to setup the API for giving the browser based report viewer access to reports at the following: Web API Implementation
For creating your own approach to how reports are served up to the browser you can use the Report Resolver.
In terms of how this all fits together.