Page 1 of 1

Report Builder Image File Path

Posted: Mon 10 Mar 2014 17:35
by willswing77
I want to build a report with a picture in it. My images are stored in two ways: a)as bitmaps in a longblob database field and b)as image file names (PICT_N1.JPG) in a varchar field.
I manage to put the longblob on the report with Picture Box.

However, I want to delete the longblob database field and use the image file name field instead. This allows me to reduce database size and store the images in the file system.

How can I produce a report with an image in it which uses a variable link to pictures in the file system? The picture toolbox allows me only a data binding to the longblob field or a fixed URL with no variables in it.

Thanks for any suggestions!

Re: Report Builder Image File Path

Posted: Tue 11 Mar 2014 16:58
by alexa
This can be done using scripts. For this, being in the .rdb document opened in dbForge, perform the following:

1. Switch to the 'Scripts' tab which is just at the bottom of the document.
2. On the top-left corner of the document, select the object of type 'Picture Box' from the dropdown menu.
3. On the top-right corner of the document, select 'Before Print' from the dropdown menu. The "private void pictureBox1_BeforePrint(..." method template will be generated.
4. Insert the following string in the generated method template:((XRPictureBox)sender).Image = Image.FromFile(GetCurrentColumnValue("pathimg").ToString());

where "pathimg" is the name of the column containing a file path. The column is present in the Data Source tool window.

Re: Report Builder Image File Path

Posted: Tue 11 Mar 2014 21:35
by willswing77
Thanks for your reply. I tried your method with no success.
When I try to preview I receive "The document does not contain any pages". A parameter input field with some odd numbers appears to choose from. Neither of the values produces a meaningful report page.
Sorry, I am new to Scripts and may have done something completely wrong?

Re: Report Builder Image File Path

Posted: Wed 12 Mar 2014 10:53
by alexa
Could you please send us the CREATE definitions of the tables the report is based on along with the .rdb report itself?

You can send a reply straight to our support system at supportATdevartDOTcom, so we will keep further correspondence with you on this issue via e-mail.