locked
Using BLOB Type Content in Report Builder RRS feed

  • Question

  • Hi,

    I am using an Oracle Database for my report in Report Builder 3.0.

    I have to show an Image in my report which is saved in database.

    The field where image is saved is of type "BLOB".

    When I try to read it in my Dataset it shows an error - "ORA-00932: inconsistent datatype: expected - got BLOB".

    Is there any method ?


    Aditya Pratap Singh
    Tuesday, December 27, 2011 5:20 AM

Answers

  • Hi Aditya_Pratap_Singh_2708,

     

    Thanks for your post and kiranmayee’s reply.

     

    I am not familiar with oracle, so I would demonstrate you an example related to SQL Server, I hope it can give you some enlightenment.

     

    1. Insert Images file into database table.

    CREATE TABLE BLOBTest

    (

    customer_code int IDENTITY(1,1),

    PicName varChar(50),

    PicData varBinary(MAX)

    );

     

    INSERT INTO BLOBTest

                    (PicName, PicData)

    SELECT 'Picture1',

    BulkColumn FROM OPENROWSET(

    Bulk 'C:\temp\Picture1.jpg', SINGLE_BLOB) AS BLOB

    2. You can use the T-sql string to retrieve the data from database to report dataset.

    select * from BLOBTest

    3. You can refer to the orignal steps to design your report, the only differece is add the PicData field to your tablix.

    4. Drag a Image control to the PicData column cell.

    5. Right-click the Image control,select Image properties.

    6. In the Image Properties dialog box type a name in the Name text box, or accept the default.

    7. (Optional) In the Tooltip text box, type text to display when the user hovers the mouse over the image in the rendered report.

    8. In Select the image source, select Database.

    9. In Use this Field, select the field (PicData field) that contains the image.

    10. In Use this MIME type, select the MIME type of the image( this example is image/jpeg).

    11. Click OK.

     

    Thanks,
    Bill Lu


    Bill Lu

    TechNet Community Support

    Wednesday, December 28, 2011 5:35 AM

All replies

  • Convert the Blob datatye to binary format and send it with the dataset. On the report, bind te column to an image control.

    I remember doing the same in Crystal Reports long long back, but never had a chance to make it work on ssrs.

    Tuesday, December 27, 2011 6:34 PM
  • Hi Aditya_Pratap_Singh_2708,

     

    Thanks for your post and kiranmayee’s reply.

     

    I am not familiar with oracle, so I would demonstrate you an example related to SQL Server, I hope it can give you some enlightenment.

     

    1. Insert Images file into database table.

    CREATE TABLE BLOBTest

    (

    customer_code int IDENTITY(1,1),

    PicName varChar(50),

    PicData varBinary(MAX)

    );

     

    INSERT INTO BLOBTest

                    (PicName, PicData)

    SELECT 'Picture1',

    BulkColumn FROM OPENROWSET(

    Bulk 'C:\temp\Picture1.jpg', SINGLE_BLOB) AS BLOB

    2. You can use the T-sql string to retrieve the data from database to report dataset.

    select * from BLOBTest

    3. You can refer to the orignal steps to design your report, the only differece is add the PicData field to your tablix.

    4. Drag a Image control to the PicData column cell.

    5. Right-click the Image control,select Image properties.

    6. In the Image Properties dialog box type a name in the Name text box, or accept the default.

    7. (Optional) In the Tooltip text box, type text to display when the user hovers the mouse over the image in the rendered report.

    8. In Select the image source, select Database.

    9. In Use this Field, select the field (PicData field) that contains the image.

    10. In Use this MIME type, select the MIME type of the image( this example is image/jpeg).

    11. Click OK.

     

    Thanks,
    Bill Lu


    Bill Lu

    TechNet Community Support

    Wednesday, December 28, 2011 5:35 AM
  • Hi Bill Lu,

    Thanks for your reply. 

    I was getting that error because I was using "SELECT DISTINCT * FROM BLOB_TABLE" .

    When I used "SELECT * FROM BLOB_TABLE" , It worked fine.

     

    Thanks   


    Aditya Pratap Singh
    Thursday, December 29, 2011 6:22 AM