or
@( Html.TelerikReporting().ReportViewer() .Id("reportViewer1") .ServiceUrl("xhttp://xxxx/api/reports/") .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html") .ReportSource(new UriReportSource() { Uri = "User.trdx" }) .ViewMode(ViewModes.INTERACTIVE) .ScaleMode(ScaleModes.SPECIFIC) .Scale(1.0) )public class Reports1Controller : ReportsControllerBase{ protected override IReportResolver CreateReportResolver() { var appPath = HttpContext.Current.Server.MapPath("~/Reports"); return new ReportFileResolver(appPath) .AddFallbackResolver(new ReportTypeResolver()); } protected override ICache CreateCache() { return CacheFactory.CreateFileCache(); }}.ReportSource(new UriReportSource() { Uri = "User.trdx" }.ReportSource(new TypeReportSource() { TypeName ="Class1.User, Class" })
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MyProject.Models.MyModel>" %>protected override void OnLoad(EventArgs e) { base.OnLoad(e); var instanceReportSource = new InstanceReportSource(); Report report = new Report1(Model); instanceReportSource.ReportDocument = report; ReportViewer1.ReportSource = instanceReportSource; ReportViewer1.ViewMode = ViewMode.Interactive; }using MyProject.Models;namespace Admissions.Reports{ using Telerik.Reporting; public partial class Report1 : Report { public Report1() { InitializeComponent(); } public Report1(MyModel model) : this() { DataSource = model; } }}@{ var uriRS = new UriReportSource() { Uri = "1"};}@(Html.TelerikReporting().ReportViewer().Id("reportViewer1") .ServiceUrl("/api/reports/") .TemplateUrl("/Content/ReportViewer/templates/telerikReportViewerTemplate.html") .ReportSource(uriRS) .ViewMode(ViewModes.INTERACTIVE) .ScaleMode(ScaleModes.SPECIFIC) .Scale(1.0) .PersistSession(false) )namespace Admissions.Controllers{ public class ReportsController : ReportsControllerBase { protected override ICache CreateCache() { return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache(); } protected override IReportResolver CreateReportResolver() { return new CustomReportResolver(); } } public class CustomReportResolver : IReportResolver { public ReportSource Resolve(string reportId) { var report = new Report(); report = new Report1(new DashboardViewModel { TotalRolesCount = "Hello Report World" }); var irs = new InstanceReportSource { ReportDocument = report }; return irs; } }}public ReportSource ReportSource{ get { // create the report source for the report var reportSource = new TypeReportSource { TypeName = _model.Report.TypeName + ", " + _model.Report.AssemblyName }; // add all report parameters foreach (var parameter in _model.Parameters) { reportSource.Parameters.Add(parameter.Parameter.Name, parameter.Value); } // set a title parameter to the title of the user's report reportSource.Parameters.Add("Title", _model.Title); return reportSource; }}public ReportSource ReportSource { get { // create the report source for the report var reportSource = new InstanceReportSource { ReportDocument = new BidTabReportByStatus() }; // add all report parameters foreach (var parameter in _model.Parameters) { reportSource.Parameters.Add(parameter.Parameter.Name, parameter.Value); } // set a title parameter to the title of the user's report reportSource.Parameters.Add("Title", _model.Title); return reportSource; } }@{ // display the report @(Html.TelerikReporting().ReportViewer() .Id("reportViewer") .ServiceUrl("/api/reports/") .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html") .ReportSource(Model.ReportSource) .ViewMode(ViewModes.INTERACTIVE) .ScaleMode(ScaleModes.SPECIFIC) .Scale(1.0) .PersistSession(false))}@model StdPOTOrderPrint@{ var uriRS = new UriReportSource() { Uri = @Model.ReportParms };}@(Html.TelerikReporting().ReportViewer() .Id("reportViewer1") .ServiceUrl(Url.Content("~/api/reports/")) .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate.html")) .ReportSource(uriRS) .ViewMode(ViewModes.INTERACTIVE) .ScaleMode(ScaleModes.SPECIFIC) .Scale(1.0) .PersistSession(false))namespace CPR.WebPortal.Controllers{ public class ReportsController : ReportsControllerBase { protected override IReportResolver CreateReportResolver() { return new CustomReportResolver(); } protected override ICache CreateCache() { return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache(); } } public class CustomReportResolver : IReportResolver { public Telerik.Reporting.ReportSource Resolve(string reportparms) { string[] stringSeparators = new string[] {"|"}; string[] sarray = reportparms.Split(stringSeparators, StringSplitOptions.None); long patientid = Convert.ToInt64(sarray[0]); long orderid = Convert.ToInt64(sarray[1]); .... PatientPhysicianOrderStandardPropertyBag orderBag = new PatientPhysicianOrderStandardPropertyBag(); PatientHelper.Populate(order, orderBag); PatientPhysicianOrderStandardDataObject _dataSource = new PatientPhysicianOrderStandardDataObject(workContext, orderBag); Telerik.Reporting.Report report = new DHS.Client.Controllers.Reporting.ReportDefinitions.PatientPhysicianOrderStandardReport(); report.DataSource = orderBag; Telerik.Reporting.InstanceReportSource irs = new Telerik.Reporting.InstanceReportSource(); irs.ReportDocument = report; return irs; } }}