Reputation: 117
I want to make PDF export in my ASP.NET Core 6 project. I use 'Rotativa' and this code to export:
public Microsoft.AspNetCore.Mvc.ActionResult Export()
{
return new ViewAsPdf("PdfReport");
}
I get this error:
Cannot implicitly convert type 'Rotativa.ViewAsPdf' to 'Microsoft.AspNetCore.Mvc.ActionResult'. An explicit conversion exists (are you missing a cast?)
Please help me - what do I need to do?
Thanks.
Upvotes: 1
Views: 1301
Reputation: 117
I just install 'Rotativa.AspNetCore' package and everything is ok.
Upvotes: 1
Reputation: 3045
Use IActionResult
instead ActionResult
public IActionResult Export()
{
return new ViewAsPdf("PdfReport");
}
Upvotes: 1