I tried many ways that you can apparently make work. Nothing. So I finally decided to trick:
public class CrystalImageHandlerController : Controller
{
public ActionResult Index()
{
return Content("");
}
protected override void OnActionExecuted(ActionExecutedContext filterContext)
{
var handler = new CrystalDecisions.Web.CrystalImageHandler();
var app = (HttpApplication)filterContext.RequestContext.HttpContext.GetService(typeof(HttpApplication));
if (app == null) return;
handler.ProcessRequest(app.Context);
}
}
I added a route to this controller, corresponding to the expected Crystal (./CrystalImageHandler.aspx), and used this controller to call the handler during the execution of the action. Not beautiful, but functional.
source
share