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
Request clarification before answering.
If you export the report using the Viewers Export button does that work?
As I said, the image is only loaded once when the report is opened. Refreshing won't show a new image
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. the image shows if I using the Viewers Export button. Dear Williams, We always use graphic to show the local image in reports and it works well. It only being blank when I set xsd file schema and xml data file as datasource.
If I comment out SetDataSource line as below, the image shows in the exported pdf( but no data because no data source set).

I've set dataset as data source before, of which records are from sql server and everything woks well. the difference here is just read xml as data source I dont know why. Just as you said, the image loaded once when report is opened. it should be opened after data source loaded. And the hardcoded graphic image should be shown, right?
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.