This is a migrated thread and some comments may be shown as answers.

Invalid image data while processing picture box

4 Answers 959 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Manish
Top achievements
Rank 1
Manish asked on 30 May 2013, 12:01 PM
Hello,

I am binding table one of columns with Panel that has textbox and picturebox. I am giving Picturebox1.value="{Fields.[RowIcon]}", where RowIcon is byte[] contains image byte. Text box value comes properly  as per its binging expr. but for picture box it says invalid image data while processing picutre box.

I also tried changing RowIcon type to Image. But got same error.

Please help.

Regards,
Manish

4 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 04 Jun 2013, 07:24 AM
Hi Manish,

Please check how the PictureBox.Value property is set to an expression in the PictureBox help article. There is also an example in the local demos located under C:\Program Files (x86)\Telerik\Reporting Q1 2013\Examples\CSharp\ReportLibrary\ProductCatalog by default - check for ictureBox1.Value.

I hope this helps.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Manish
Top achievements
Rank 1
answered on 07 Jun 2013, 12:33 PM
Hi Stef,

Thanks. I got image in picturebox but when i put it in panel with text box it does not show image. I want to bind image and text in one column togather.

Or i can have separate column for picturebox but in that case i will have to merge two column headers of image and data text columns.

Please help in either case.

Thanks,
Manish
0
Stef
Telerik team
answered on 12 Jun 2013, 08:59 AM
Hi Manish,

Please check the attached sample report definition. It illustrates a Table item bound to a SqlDataSource component, which retrieves data from AdventureWorks database. In a single cell of the table is added a Panel item on which we placed PictureBox and TextBox item for the example.

If you need further help, we need to know the report definition and what data is passed to it.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Michela
Top achievements
Rank 1
answered on 08 Oct 2018, 09:13 AM

Hi, I had the same error and I solved it by simply deleting "using(MemoryStream ms ..."

 

In my code, I create a method to convert image blob to System.Drawing.Image (the only type of image that Telerik Reporting digests)

public static System.Drawing.Image GetImageFromByteArray(byte[] imageBlob)
        {
            System.Drawing.Image result = null;
            if (imageBlob != null)
            {
                MemoryStream ms = new MemoryStream(imageBlob);//you mustn't use "using MemoryStream ..."
                result = System.Drawing.Image.FromStream(ms);

            }
            return result;
        }

 

Tags
General Discussions
Asked by
Manish
Top achievements
Rank 1
Answers by
Stef
Telerik team
Manish
Top achievements
Rank 1
Michela
Top achievements
Rank 1
Share this question
or