Hi, I created a image field with blob data type in one table. When I select item, I can view the picture. My question is how to import images to the system and if it is imported, how to display them in a report? Is there any way to store the images in some other drives not in the current Navision storage locations? Thanks!
0
Comments
In the report, you can copy the picture-box of the form.
In the OnAfterCurrentRecord, you need to put : CALCFIELDS(Picture);
It is possible to store the pictures on disk and when needed, you import them on the fly in a BLOB to show them.
But this takes some coding.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Why not import the images in the Item-table? So they are connected without problem.
Otherwise, you can put the primary key of that table in new fields in the item-table or add in the new table the primary key of the item.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
And with Item.Picture.IMPORT("full path to file"); you import the picture.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
http://dynamicsusers.org/forums/post/1415.aspx
also you don't need to save a pic in a blob in navision to show it on a report or form
you can type the location too.
ex. c:\mypic.bmp
http://www.BiloBeauty.com
http://www.autismspeaks.org
Now if you want them to appear in your item card picture without importing them. Place all the pics in a network folder (I use a folder called "p:\BMP" p for pictures
On the Item Picture Form
OnAfterGetRecord() That's it - now your pic will show.
If you want to actually import them into Navision you can create a report to import them all at once.
Onaftergetrecord you add
note P:\ is MY DRIVE you can set it up however you want.
http://www.BiloBeauty.com
http://www.autismspeaks.org
2Gig.
IF Item.Picture.HASVALUE
Can I write as
If Sales header.picture.hasvalue
And what does picture stand for, value, variabl or...? Thanks for all your help?
The asterisk comes from a flag in the actual table. The picture is stored in a Blog, and the blob is not actually a part of the Navision table.
There are two things you need to do.
1. the Picture filed needs to be the source expression in a PictureBox, it cant be a normal text box.
2/ Depending how you call the Picture field, you may need to do a calcfields. Its not really a calcfields, it is just telling Navision to get the data from the blob:
SalesHeader.Calcfields(Picture); // or something like that.
2) is your picture saved outside navsion?
3) Where did you put the calcfields command?
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org
I copied that code from form 1 after "Picture"/Import menu item OnPush trigger. I think you'll get the "picture"
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Actually Harry alrady posted this code on page one of THIS thread
:oops: ... this thread has a page 1 ... :oops:
Yeah well ... he asked twice, so ...
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
1) is your picture saved in a blob field?
2) is your picture saved outside navsion?
3) Where did you put the calcfields command?
Yes, all the pictures are saved in a blob field, but can't see the picture except asterisk(still the same question)
All pictures are saved in a folder of network which are outside of Navision
Calcfields command are put after OnAfterGetRecord() of salesheader.
I really appreciate your assistance. Sorry for my questions! Thanks!
How did you put code in OnAfterGetRecord if your license doesn't allow you??
Please be clear or this will go on forever.
-What Table do you have your picture Blob Fields saved in.
-When you see the "*" it means the blob field is filled.
-Are these pics BMP's?
lets start with that.
Note: The methods mentioned earlier do work you just didn't impliment them correctly.
Just curious:If the pics you are talking about are related to sales orders why is the title called Item Images?
http://www.BiloBeauty.com
http://www.autismspeaks.org
How did you put code in OnAfterGetRecord if your license doesn't allow you??
I put the code in the report of OnAfterGetRecord, not on the form. We have licence in report, but not in table or form.
-What Table do you have your picture Blob Fields saved in.
I saved the pictures in a new table created, which has relationship with sales header. I created a new Bolb field in this table.
-When you see the "*" it means the blob field is filled.
-Are these pics BMP's?
Yes, all the pictures are saved with bmp with the file name of the sales order no. After I ran the report, I checked the blob field of the table and found it has * in it. I don't know why this field is filled without anything?
Thanks!
Do the following on the report
1. On the data item property of the report place the name of the field you want to show in the calcfields.
2. In the report sections place a picture box instead of text box.
3. on the property of the picture box replace the SourceExpr with the name of the field (blob/picture field).
4. Save the report.
5. Then try to run.
This process works fine with me.
Hope this helps.