Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

export the image through Report

136 views
Skip to first unread message

gahlot

unread,
Jun 16, 2008, 2:00:07 AM6/16/08
to
export the image through Report is possible ya not
if possible what is code and methord.

Daniel Rimmelzwaan

unread,
Jun 16, 2008, 9:33:36 AM6/16/08
to
What do you mean "export through report"?

If you mean that you want to display an image on a report then take a look
at the standard NAV Sales Invoice. You'll find a PictureBox control in the
header, with the CompanyInfo.Picture as the SourceExpr of the control. The
Picture field in the Company Info table is a BLOB type field. The trick in
displaying the picture is that you have to do a CALCFIELD before NAV knows
how to actually show the picture. Take a look at the code in the
OnPreReport, you will find a statement CompanyInfo.CALCFIELD(Picture).

If you mean you want to export the image to an external file, take a look at
form 1 (Company Information) in a standard database. There's a button called
"Picture", and it has an Export selection. Open the code there and see how
it's done.
--
Daniel Rimmelzwaan
MVP Dynamics NAV
www.risplus.com

"gahlot" <er.g...@gmail.com> wrote in message
news:30ff9870-a8e4-403f...@n19g2000prg.googlegroups.com...

Savatage

unread,
Jun 16, 2008, 2:01:01 PM6/16/08
to
Say you have a bunch of Items that have pictures imported into blob fields.

Now you want to export them all or some (using filter) in one shot.
This is what I would do.
Dataitem = ITEM

Create a Variable CurRec Type Integer.

OnPreDataItem()
CurRec :=0;

OnPostDataitem()
Message('Number of Pictures Exported: %1',CurRec);

OnAfterGetRecord()
Item.CALCFIELDS.Picture;
If Item.Picture.HASVALUE then
Item.Picture.EXPORT('c:temp\'+Item."No."+'BMP',FALSE);

If Item.Picture.HASVALUE then
CurRec := CurRec +1;

Savatage

unread,
Jun 16, 2008, 2:07:01 PM6/16/08
to
Ooops Change:
OnAfterGetRecord()
Item.CALCFIELDS.Picture;

If Item.Picture.HASVALUE
THEN BEGIN


Item.Picture.EXPORT('c:temp\'+Item."No."+'BMP',FALSE);

CurRec := CurRec +1;
End;

0 new messages