I'm using ReportProcessor in my .NET 8 project to render a trdp report. Rendering in PDF works fine but when I try to render as XLSX I'm getting the error in the subject line.
I've triple checked that I have installed all dependencies per this article OpenXML and XPS options not visible. Unavailable rendering format - Telerik Reporting
Any suggestions?
[Authorize]
public IActionResult Export(long id, string reportName="Statement.trdp", string format="PDF")
{
var baseUrl = $"{Request.Scheme}://{Request.Host}{Request.PathBase}";
var reportProcessor = new ReportProcessor();
var uriReportSource = new UriReportSource
{
Uri = Path.Combine(_environment.ContentRootPath, "Reports", reportName)
};
uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("stmtId", id));
uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("url", baseUrl));
var result = reportProcessor.RenderReport(format, uriReportSource, null);
return File(result.DocumentBytes, result.MimeType);
}