I am using reporting package - AspNetCore.Reporting -2.1.0. I want to print my RDLC report having an external image. During rendering to pdf an error occurred.
An error occurred during local report processing.;Report 'Payslip' contains external images. The EnableExternalImages property has not been set for this report.
Rendering part of my code:
string reportFileName = "Payslip.rdlc";
if (paySlip.IsHourlySalary)
reportFileName = "Payslip.rdlc";
else
{
reportFileName = "PaySlipForAnnual.rdlc";
}
string ReportPath;
if (_webHostEnvironment != null)
ReportPath = Path.Combine(_webHostEnvironment.ContentRootPath + "\\TMReports", reportFileName);
else
{
ReportPath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "/TMReports", reportFileName);
}
LocalReport localReport = new LocalReport(ReportPath);
message += " Before localReport.SetParameters(param);";
message += " Before localReport.DataSources.Add(cd);";
localReport.AddDataSource("dsPaySlip", dtPaySlip); // Add datasource here
message += " Before byte[] bytes = localReport.Render(";
var result = localReport.Execute(RenderType.Pdf, 1, reportParams, mimeType);
return result.MainStream;
Run this before Rendering
Edit:
Seems the open source library you are using does not expose the variable nor the method you need.
But the methods are there in a private variable of the sealed class.
So you can still change it's value by reflection...
It's not pretty but it will get the job done.