title: BIRT dyanamic image report generation
body: <p>In my database I have table <code>Rapid_Slum_Appraisal</code></p>
  
  <pre><code>id | general_info_left_image  
  --------------------------------------
   1 | http://127.0.0.1/media/image1.jpg  
   2 | http://127.0.0.1/media/image2.jpg       
  </code></pre>
  
  <p>if you hit the URL you can see the image in browser.         </p>
  
  <p>I have created image.rptdesign file using BIRT designer.In it I have created a data source and data set to retrieve general_info_left_image from database.</p>
  
  <p>Step I followed - </p>
  
  <ol>
  <li><p>First I created Data source and data set to retrieve image from database.</p></li>
  <li><p>Then I drag image report item from toolbox to create dynamic image. </p></li>
  <li><p>when set data type to Blob and try to view the report using BIRT Viewer,I see below error and image is not displayed.</p></li>
  </ol>
  
  <blockquote>
    <p>Can not convert the value of
    <a href="http://127.0.0.1:8000/media/2697dd7fdfef2c54b6bbc4698ec14b8e_7rRHk5J.jpg" rel="nofollow">http://127.0.0.1:8000/media/2697dd7fdfef2c54b6bbc4698ec14b8e_7rRHk5J.jpg</a>
    to Binary type</p>
  </blockquote>
  
  <ol start="4">
  <li>when I set data type to string the image is not displayed</li>
  </ol>
  
  <p>image.rptdesign file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1"&gt;
      &lt;property name="createdBy"&gt;Eclipse BIRT Designer Version 4.6.0.v201606072122&lt;/property&gt;
      &lt;property name="units"&gt;in&lt;/property&gt;
      &lt;property name="iconFile"&gt;/templates/blank_report.gif&lt;/property&gt;
      &lt;property name="bidiLayoutOrientation"&gt;ltr&lt;/property&gt;
      &lt;property name="imageDPI"&gt;96&lt;/property&gt;
      &lt;data-sources&gt;
          &lt;oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="django" id="4"&gt;
              &lt;list-property name="privateDriverProperties"&gt;
                  &lt;ex-property&gt;
                      &lt;name&gt;metadataBidiFormatStr&lt;/name&gt;
                      &lt;value&gt;ILYNN&lt;/value&gt;
                  &lt;/ex-property&gt;
                  &lt;ex-property&gt;
                      &lt;name&gt;disabledMetadataBidiFormatStr&lt;/name&gt;
                  &lt;/ex-property&gt;
                  &lt;ex-property&gt;
                      &lt;name&gt;contentBidiFormatStr&lt;/name&gt;
                      &lt;value&gt;ILYNN&lt;/value&gt;
                  &lt;/ex-property&gt;
                  &lt;ex-property&gt;
                      &lt;name&gt;disabledContentBidiFormatStr&lt;/name&gt;
                  &lt;/ex-property&gt;
              &lt;/list-property&gt;
              &lt;property name="odaDriverClass"&gt;org.postgresql.Driver&lt;/property&gt;
              &lt;property name="odaURL"&gt;jdbc:postgresql://127.0.0.1/django&lt;/property&gt;
              &lt;property name="odaUser"&gt;postgres&lt;/property&gt;
              &lt;encrypted-property name="odaPassword" encryptionID="base64"&gt;c29mdGNvcm5lcg==&lt;/encrypted-property&gt;
          &lt;/oda-data-source&gt;
      &lt;/data-sources&gt;
      &lt;data-sets&gt;
          &lt;oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="image" id="5"&gt;
              &lt;property name="nullsOrdering"&gt;nulls lowest&lt;/property&gt;
              &lt;list-property name="columnHints"&gt;
                  &lt;structure&gt;
                      &lt;property name="columnName"&gt;general_info_left_image&lt;/property&gt;
                      &lt;property name="analysis"&gt;dimension&lt;/property&gt;
                      &lt;text-property name="displayName"&gt;general_info_left_image&lt;/text-property&gt;
                      &lt;text-property name="heading"&gt;general_info_left_image&lt;/text-property&gt;
                  &lt;/structure&gt;
              &lt;/list-property&gt;
              &lt;structure name="cachedMetaData"&gt;
                  &lt;list-property name="resultSet"&gt;
                      &lt;structure&gt;
                          &lt;property name="position"&gt;1&lt;/property&gt;
                          &lt;property name="name"&gt;general_info_left_image&lt;/property&gt;
                          &lt;property name="dataType"&gt;string&lt;/property&gt;
                      &lt;/structure&gt;
                  &lt;/list-property&gt;
              &lt;/structure&gt;
              &lt;property name="dataSource"&gt;django&lt;/property&gt;
              &lt;list-property name="resultSet"&gt;
                  &lt;structure&gt;
                      &lt;property name="position"&gt;1&lt;/property&gt;
                      &lt;property name="name"&gt;general_info_left_image&lt;/property&gt;
                      &lt;property name="nativeName"&gt;general_info_left_image&lt;/property&gt;
                      &lt;property name="dataType"&gt;string&lt;/property&gt;
                  &lt;/structure&gt;
              &lt;/list-property&gt;
              &lt;xml-property name="queryText"&gt;&lt;![CDATA[select general_info_left_image 
  from public.master_rapid_slum_appraisal]]&gt;&lt;/xml-property&gt;
              &lt;xml-property name="designerValues"&gt;&lt;![CDATA[&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel"&gt;
    &lt;Version&gt;2.0&lt;/Version&gt;
    &lt;design:ResultSets derivedMetaData="true"&gt;
      &lt;design:resultSetDefinitions&gt;
        &lt;design:resultSetColumns&gt;
          &lt;design:resultColumnDefinitions&gt;
            &lt;design:attributes&gt;
              &lt;design:identifier&gt;
                &lt;design:name&gt;general_info_left_image&lt;/design:name&gt;
                &lt;design:position&gt;1&lt;/design:position&gt;
              &lt;/design:identifier&gt;
              &lt;design:nativeDataTypeCode&gt;12&lt;/design:nativeDataTypeCode&gt;
              &lt;design:precision&gt;100&lt;/design:precision&gt;
              &lt;design:scale&gt;0&lt;/design:scale&gt;
              &lt;design:nullability&gt;NotNullable&lt;/design:nullability&gt;
              &lt;design:uiHints&gt;
                &lt;design:displayName&gt;general_info_left_image&lt;/design:displayName&gt;
              &lt;/design:uiHints&gt;
            &lt;/design:attributes&gt;
            &lt;design:usageHints&gt;
              &lt;design:label&gt;general_info_left_image&lt;/design:label&gt;
              &lt;design:formattingHints&gt;
                &lt;design:displaySize&gt;100&lt;/design:displaySize&gt;
              &lt;/design:formattingHints&gt;
            &lt;/design:usageHints&gt;
          &lt;/design:resultColumnDefinitions&gt;
        &lt;/design:resultSetColumns&gt;
        &lt;design:criteria/&gt;
      &lt;/design:resultSetDefinitions&gt;
    &lt;/design:ResultSets&gt;
  &lt;/model:DesignValues&gt;]]&gt;&lt;/xml-property&gt;
          &lt;/oda-data-set&gt;
      &lt;/data-sets&gt;
      &lt;page-setup&gt;
          &lt;simple-master-page name="Simple MasterPage" id="2"&gt;
              &lt;page-footer&gt;
                  &lt;text id="3"&gt;
                      &lt;property name="contentType"&gt;html&lt;/property&gt;
                      &lt;text-property name="content"&gt;&lt;![CDATA[&lt;value-of&gt;new Date()&lt;/value-of&gt;]]&gt;&lt;/text-property&gt;
                  &lt;/text&gt;
              &lt;/page-footer&gt;
          &lt;/simple-master-page&gt;
      &lt;/page-setup&gt;
      &lt;body&gt;
          &lt;table id="6"&gt;
              &lt;property name="dataSet"&gt;image&lt;/property&gt;
              &lt;list-property name="boundDataColumns"&gt;
                  &lt;structure&gt;
                      &lt;property name="name"&gt;general_info_left_image&lt;/property&gt;
                      &lt;text-property name="displayName"&gt;general_info_left_image&lt;/text-property&gt;
                      &lt;expression name="expression" type="javascript"&gt;dataSetRow["general_info_left_image"]&lt;/expression&gt;
                      &lt;property name="dataType"&gt;string&lt;/property&gt;
                  &lt;/structure&gt;
              &lt;/list-property&gt;
              &lt;column id="15"/&gt;
              &lt;header&gt;
                  &lt;row id="7"&gt;
                      &lt;cell id="8"/&gt;
                  &lt;/row&gt;
              &lt;/header&gt;
              &lt;detail&gt;
                  &lt;row id="10"&gt;
                      &lt;cell id="11"&gt;
                          &lt;image id="16"&gt;
                              &lt;property name="dataSet"&gt;image&lt;/property&gt;
                              &lt;list-property name="boundDataColumns"&gt;
                                  &lt;structure&gt;
                                      &lt;property name="name"&gt;general_info_left_image&lt;/property&gt;
                                      &lt;expression name="expression" type="javascript"&gt;dataSetRow["general_info_left_image"]&lt;/expression&gt;
                                      &lt;property name="dataType"&gt;blob&lt;/property&gt;
                                      &lt;property name="allowExport"&gt;true&lt;/property&gt;
                                  &lt;/structure&gt;
                              &lt;/list-property&gt;
                              &lt;property name="source"&gt;expr&lt;/property&gt;
                              &lt;expression name="valueExpr"&gt;row["general_info_left_image"]&lt;/expression&gt;
                          &lt;/image&gt;
                      &lt;/cell&gt;
                  &lt;/row&gt;
              &lt;/detail&gt;
              &lt;footer&gt;
                  &lt;row id="13"&gt;
                      &lt;cell id="14"/&gt;
                  &lt;/row&gt;
              &lt;/footer&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/report&gt;
  </code></pre>
  
  <p>System Information:</p>
  
  <pre><code>Ubuntu 16.04
  BIRT  4.6.0
  Java Version
  openjdk version "1.8.0_91"
  OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
  OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)  
  </code></pre>