Loading Images from XML

Stimulsoft Reports.WEB discussion
Post Reply
anerling
Posts: 28
Joined: Wed Jul 16, 2014 6:28 am

Loading Images from XML

Post by anerling »

Hello Community,

I have a question about loading images from a XML data. The images are encoded in base64. Is there any possibility loading that images by the reportgenerator ? The problem is the StiMvcMobileViewer.GetReportSnapshotResult raises an exception because it could not convert the base64 string into an System.Drawing.Image.
Do you have an idea solving that problem ?

Yours sincerely
ANerling
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Loading Images from XML

Post by HighAley »

Hello, ANerling.
anerling wrote:I have a question about loading images from a XML data. The images are encoded in base64. Is there any possibility loading that images by the reportgenerator ? The problem is the StiMvcMobileViewer.GetReportSnapshotResult raises an exception because it could not convert the base64 string into an System.Drawing.Image.
Do you have an idea solving that problem ?
What type is used for this column?
Here is a description from the XML Scheme of our Demo XML data:

Code: Select all

<xs:element name="Picture" type="xs:base64Binary" minOccurs="0" />
Thank you.
anerling
Posts: 28
Joined: Wed Jul 16, 2014 6:28 am

Re: Loading Images from XML

Post by anerling »

My XML Scheme contains base64 as string:

Code: Select all

<?xml version="1.0" standalone="yes"?>
<Report> 
   <ImageList Quantity="2"> 
      <Image Content="/9j/4AAQSkZJRg"/>
      <Image Content="/9j/4AAQSkZJRg"/>
   </ImageList>
</Report>

Code: Select all

<xs:attribute name="image" type="xs:string" />
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Loading Images from XML

Post by HighAley »

Hello.

The type should be type="xs:base64Binary".
Our you should change the Type of the Column in Dictionary to byte[].

Thank you.
anerling
Posts: 28
Joined: Wed Jul 16, 2014 6:28 am

Re: Loading Images from XML

Post by anerling »

I solved the problem.
I forgot to delete the path of the xsd in the template.
Thank you for your help.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Loading Images from XML

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
Post Reply