Skip to content

Instantly share code, notes, and snippets.

@tawman
Created February 12, 2012 03:58
Show Gist options
  • Save tawman/1806138 to your computer and use it in GitHub Desktop.
Save tawman/1806138 to your computer and use it in GitHub Desktop.
An example ASP.NET MVC3 Controller wired up with a DoddleReport ReportResult Action
using System.Web.Mvc;
using DoddleReport;
using DoddleReport.Web;
using PetaPocoPivot.Services;
namespace PetaPocoPivot.Controllers
{
public class HomeController : Controller
{
private readonly IRepository _repository = new Repository();
public ActionResult Index()
{
var results = _repository.GetEmployeeReport();
return View(results);
}
public ReportResult PivotReport()
{
var results = _repository.GetEmployeeReport();
var report = new Report(results.ToReportSource());
return new ReportResult(report);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment