I am currently working towards moving our report files into database storage. I have setup a custom resolver that is able to get the report from the id properly; however, when the subreport is loaded, it does not appear to be using the /api/reports serviceUrl. instead, it is looking in the root directory of the project in visual studio and not being routed through the Reports controller. Of course, the report is not there. What do I need to do to make the reports to evaluate on the serviceUrl to get it like the other reports?
Here's my resolver:
public class DatabaseReportResolver : Telerik.Reporting.Services.Engine.IReportResolver
{
public ReportSource Resolve(string message)
{
using (var _context = new CommonDataContext())
{
var report = _context.ReportRecord.FirstOrDefault(x => x.UniqueName == message);
if(report == null)
{
return null;
}
var fileContent = report.ReportFiles.OrderByDescending(x => x.DateActive).FirstOrDefault();
if (fileContent != null)
{
var file = fileContent.File;
XmlReportSource source = new XmlReportSource();
source.Xml = System.Text.Encoding.Default.GetString(file);
return source;
}
}
return null;
}
}