Hi,
I am using product enity and I want to add product image. Is it possible ?
Also I need to export product record with its images. Is it possible ?
Thanks,
keyur shah.
*This post is locked for comments
Hi,
I am using product enity and I want to add product image. Is it possible ?
Also I need to export product record with its images. Is it possible ?
Thanks,
keyur shah.
*This post is locked for comments
In excel CRM only use view for exporting data. So without customization we could not show image in excel file.
System enitity have one enitityimage field and display it from form property. So it is usable for set image for record.
I got enitityimage field in word template. It is working for me.
1. Create word template for entity.
2. Go to developer section.
3. Use xml source. now you have enitity all fields.
4. Find enitityimage field and drag&drop.
Thanks,
keyur shah.
Hi,
Setting a product image is OOB functionality. After setting image for product, while exporting to excel you can retrieve product image using producturl property
Refer below code to retreive image file from product
var url = imageurl;
if (!string.IsNullOrEmpty(url))
{
WebRequest request = WebRequest.Create(url);
WebResponse response = request.GetResponse();
var imgstream = response.GetResponseStream()
byte[] imagebyte;
using (MemoryStream ms = new MemoryStream())
{
imgstream.CopyTo(ms);
imagebyte = ms.ToArray();
}
//Now convert imagebyte to file
//Attach product data and image in excel
For multiple images you can attach those into notes and retrieve it while creaing Excel
You can try this.
First retrieve the attachment
msdn.microsoft.com/.../gg328429.aspx
Then use Excel API to pass this file to target document
stackoverflow.com/.../how-to-insert-a-picture-in-to-excel-from-c-sharp-app
https://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.shapes.addpicture.aspx
Hello Grigoriy,
Thanks for response.
I need to export excel. Product record with it's attached image would display in excel file.
Is it possible?
Hello.
You can add image as note's attachment on form entity.
Export will be a little bit tricky.
You'll need to retrieve noteId by regardingObjectId field from note entity, then retrieve attachment and create file from byte[].
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156