c# - Insert image to crystal reports -


insert image crystal report have ado.net data connection i'm using

<xs:element name="drawing" type="xs:byte" minoccurs="0" /> 

for image field, how can use image byte data display image in crystal reports 2013. i'm not using backend coding because there's possible many images in retrieved data, here's data structure of table "drawing" image field of data have stored byte enter image description here

i'm using image contained report sub report

i not sure if understood question, let me share may lead useful. understand said there no "backending code", hope may contain useful tip case.

when use image in crystal reports, it's type base64binary in xsd.

in dataset, it's type byte[].

we save image serialized string in database. that:

filestream stream = new filestream(filepath, filemode.open); binaryreader binreader = new binaryreader(stream); byte[] buffer = new byte[(int) stream.length]; buffer = binreader.readbytes((int) stream.length); string serialized = convert.tobase64string(buffer) 

we byte array put in dataset:

byte[] buffer = convert.frombase64string(serialized) 

in crystal report design tool, drag field document.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -