cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Image shown issue

huayuz
Explorer
0 Likes
1,488

Hi,

I set a report with .xsd file as schema of table. and I insert an OLE object with graphic location to load an image.

Here comes the strange thing. Image does not show when I set the data source and export pdf file, every filed shows correctly but image. However, Image shows if I don't set data source and export pdf.

below is how I set the datasource:

 void SetXmlDataSource(ReportDocument report)
        {
            if(!Utils.CheckFileExists(_configuration.Schema))
            {
                throw new Exception($"File {_configuration.Schema} does not exist");
            }
            if(!Utils.CheckFileExists(_commandLine))
            {
                throw new Exception($"File {_commandLine} does not exist");
            }        
            var ds = new DataSet();
            ds.ReadXmlSchema(_configuration.Schema);
            ds.ReadXml(_commandLine);
            report.SetDataSource(ds);
        }<br>

Language: C# (.net4.5)

OS Platform: Windows Server 2016 (x64)

SDK: SP32

Crystal Reports Version: Crystal Report 2020

View Entire Topic
DellSC
Active Contributor
0 Likes

You need to make sure that the image is in a location that the web application server software has acces to. For example, if the image is somewhere on the network and you're running your app in Tomcat, Tomcat would have to be running under the credentials of a service account that has access to the network folder where the image is located. The same holds true for IIS. Web application server software, by default, is usually locked down security-wise because of the higher risk of attacks through the web.

-Dell

huayuz
Explorer
0 Likes

Thanks for your reply. Yah, I am sure that the image is available for application. Because image shows if I comment out SetXmlDataSource codes. It might be a issue I think, could you guys take a look at it?

Thanks

DellSC
Active Contributor
0 Likes

I'm not an SAP employee, but don.williams might be able to take a look at it.

-Dell