Posted 18 December 2019, 8:09 pm EST
Hello Goran,
Have you changed the save report path in the “SaveReport” method like as follow:
public string SaveReport(string name, Report report, bool isTemporary = false)
{
var reportName = isTemporary
? $"{Guid.NewGuid().ToString("D")}.rdlx"
: GetReportResourceName(name);
report.Name = name;
if (isTemporary)
{
reportName = $"{TempReportPrefix}{reportName}";
_[b]rootFolder = new DirectoryInfo(String.Format(@"{0}.\resources\", HttpRuntime.AppDomainAppPath));[/b]
}
var reportFullPath = Path.Combine(_rootFolder.FullName, reportName);
var dirPath = Path.GetDirectoryName(reportFullPath);
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
byte[] reportXml = ReportConverter.ToXml(report);
var absoluteReferences = ReportResources.GetReferences(reportXml);
var reportFullUri = new Uri(reportFullPath);
var referencesMap = new Dictionary<string, string>();
foreach (var resourceAbsolutePath in absoluteReferences)
{
if (!IsValidPath(_rootFolder.FullName, resourceAbsolutePath)) continue;
if (!TryUpdateRelativePath(_rootFolder.FullName, reportFullPath, resourceAbsolutePath, out string resourceRelativePath)) continue;
referencesMap.Add(resourceAbsolutePath, resourceRelativePath);
}
var updReportXml = ReportResources.UpdateReferences(reportXml, referencesMap);
File.WriteAllBytes(reportFullPath, updReportXml);
var reportId = GetResourceId(reportName.Replace('\\', '/'));
return reportId;
}
Also, if you changed the report save path then you need to change the relative path of all resources which have been used in the report as all are located in DesignerRootDirectory folder.
Sorry, Still I am not able to reproduce the issue at my end. Please refer to the attached video. Request to please confirm If I am missing something.
https://www.dropbox.com/s/n3llcpg3e8vlokh/2019-12-19%20at%2014-29-54.mp4?dl=0
Thanks,
Mohit