Skip to content

Instantly share code, notes, and snippets.

@mgroves
Created January 3, 2014 01:02
Show Gist options
  • Select an option

  • Save mgroves/8230564 to your computer and use it in GitHub Desktop.

Select an option

Save mgroves/8230564 to your computer and use it in GitHub Desktop.
public class ReportingController : BaseController
{
public ActionResult Index()
{
var objDataSource = new ObjectDataSource();
objDataSource.DataSource = typeof (EzReportData);
objDataSource.DataMember = "GetAllTerritories";
objDataSource.Parameters.Add("ez", typeof(int), 1);
var report = new TerritoryReport();
report.DataSource = objDataSource;
var reportSource = new InstanceReportSource();
reportSource.ReportDocument = report;
ViewBag.TheReport = reportSource;
return View();
}
}
<body>
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl("/api/reports/")
.TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html")
.ReportSource((InstanceReportSource)ViewBag.TheReport)
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(false)
)
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment