Hello, I have the following route:
routes.MapRoute("RelatorioDemonstrativoResultadoExercicio", "downloads/relatorios/Relatorio_DRE_{dataInicio}_{dataTermino}.pdf", new { controller = "RelatorioFinanceiro", action = "DemonstrativoResultadoExercicio" });
Use it to create a PDF and download it to the client.
The problem is that it has stopped working. I updated the MVC and just stopped.
It no longer locates the controller or anything.
However, if I do this:
routes.MapRoute("RelatorioDemonstrativoResultadoExercicio", "downloads/relatorios/Relatorio_DRE/{dataInicio}/{dataTermino}", new { controller = "RelatorioFinanceiro", action = "DemonstrativoResultadoExercicio" });
It works again.
Does anyone know what happened? What should I do to make my old route work?
Here is the Controller that should be triggered:
public void DemonstrativoResultadoExercicio(DateTime dataInicio, DateTime dataTermino)
{
dataInicio = dataInicio.Date;
dataTermino = new DateTime(dataTermino.Year, dataTermino.Month, dataTermino.Day, 23, 59, 59);
BancoDadosBO db = new BancoDadosBO();
RelatorioFinanceiroCO.DemonstrativoResultadoExercicio(Response.OutputStream, db, idContaSistema, idUsuario, dataInicio, dataTermino);
db.Commit();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment");
Response.End();
}