Replied 10 October 2019, 10:18 pm EST
No, you don't need to create a different resource locator for all of this. You just need to create a single resource locator. You need to handle IF else condition for all images, themes and subreport in the GetResource method.
public override Resource GetResource(ResourceInfo resourceInfo)
// URI you can give API address of theme
Uri uri = new Uri("file:///C:/Users/MohitG/source/repos/JSViewer_MVC/JSViewer_MVC/LocateDataSoource.rdlx");
//Here it compare the resource name(either theme/image/subreport), load the data to the specfic property.
byte _buffer = System.Text.UTF8Encoding.UTF8.GetBytes(File.ReadAllText(@"C:\Users\MohitG\source\repos\JSViewer_MVC\JSViewer_MVC\LocateDataSoource.rdlx"));
MemoryStream _ms = new MemoryStream(_buffer);
if (_ms != null)
_resource = new Resource(_ms,uri);
>>But this does not seem applicable to the WebViewer since it does not use PageReports
Sorry for the confusion, I had provided the documentation link to just know more about ResourceLocator. You can use directly use the GrapeCity.ActiveReports.PageReportModel.Report objects as shown in the provided forum link.
private object GetReport(string arg)
var stream = new FileStream($@"C:\Users\MohitG\source\repos\JSViewer_MVC\JSViewer_MVC\main.rdlx", FileMode.Open);
var resourceLocator = new SubReportResourceLocator();
if (stream == null)
throw new ReportNotFoundException();
using (var reader = new StreamReader(ReportConverter.ToXml(GrapeCity.ActiveReports.PageReportModel.Report object)))
var report = PersistenceFilter.Load(reader, resourceLocator);
report.Site = new ReportSite(resourceLocator);
report.Name = "Main.rdlx";
Hope it clarifies your question.