Adding Image Resource - Image Not Showing
Posted: Fri Oct 16, 2020 9:08 am
I've attempted to add an image programmatically as a resource so the user can select their company logo which is already available in our system.
The code I've used to create the resource is
The above adds the resource to the list:

However when dragging this image into the designer, the image is not showing in preview or when the report is saved and viewed from the viewer.
If I save the report, then reload it, the image in the editor changes to the following as well:

How can I fix this? Is the code I'm using to generate the resource image correct?
The code I've used to create the resource is
Code: Select all
let report = new Stimulsoft.Report.StiReport();
let companyLogo = new Stimulsoft.Report.Dictionary.StiResource();
companyLogo.name = 'CompanyLogo'
companyLogo.alias = 'Company Logo'
companyLogo.type = Stimulsoft.Report.Dictionary.StiResourceType.Image
companyLogo.content = Stimulsoft.System.IO.Http.getFile("http://dev.mysite.local/style/default/images/logo.png", true);
report.dictionary.resources.add(companyLogo)

However when dragging this image into the designer, the image is not showing in preview or when the report is saved and viewed from the viewer.
If I save the report, then reload it, the image in the editor changes to the following as well:

How can I fix this? Is the code I'm using to generate the resource image correct?