How to add a image in ssrs by using CRM 2011?
-
Friday, February 08, 2013 10:48 AM
Hi All,
Can anyone please help me out on this.
How can i get the images that attached in notes entity? For example : i have contact entity in that entity I am attaching some images in notes. How can I show the image in ssrs reports?
All Replies
-
Friday, February 08, 2013 10:56 AMModerator
Hello,
Check following article - http://weblogs.asp.net/gayanperera/archive/2009/10/01/ssrs-report-show-dynamics-crm-note-attachment.aspx
- Proposed As Answer by Neil BensonMVP, Moderator Friday, February 08, 2013 11:07 AM
-
Friday, February 08, 2013 10:57 AM
Hi Senthil,
Add an image control to you report and map the DocumentBody field from annotation entity.
Go through the below link.
http://jlattimer.blogspot.in/2012/08/ssrs-report-image-from-crm-note.html
Chandan - http://mscrm-chandan.blogspot.in/ I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful !!!
- Proposed As Answer by Neil BensonMVP, Moderator Friday, February 08, 2013 11:07 AM
-
Monday, February 11, 2013 10:04 AM
Hi Andrii,
Thanks for you reply, but i wanna know how to show this thing in database. For example : I have a contact entity and for the particular contact I am attaching some image. I wanna show the image in reports. how to join both the contact and note entity in crm 4 and can you please tell me the common field to map both the entity. Once again thanks for your reply.
-
Monday, February 11, 2013 10:05 AM
Hi Chandan,
Thanks for you reply, but i wanna know how to show this thing in database. For example : I have a contact entity and for the particular contact I am attaching some image. I wanna show the image in reports. how to join both the contact and note entity in crm 4 and can you please tell me the common field to map both the entity. Once again thanks for your reply.
-
Monday, February 11, 2013 10:09 AMModerator
You should attentively check article I have provided and try following query with it:
Select fc.FullName ,(Select top 1 documentbody From FilteredAnnotation a where a.objectid = fc.contactid and a.isdocument = 1) documentbody From FilteredContact fc
Of course you will have to add required filtration to subquery.
- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:24 PM
-
Monday, February 11, 2013 11:14 AM
Hi Andrii,
Thanks for your reply. I am unable to view image. I am getting some error in the report (Invalid data type). So please help me on this. Once again thanks for your reply.
-
Monday, February 11, 2013 11:31 AMModerator
Hi Andrii,
Thanks for your reply. I am unable to view image. I am getting some error in the report (Invalid data type). So please help me on this. Once again thanks for your reply.
Could you please provide select query you use and screenshot that displays the result of select?- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:24 PM
-
Monday, February 11, 2013 11:47 AM
Hi Andrii,
select fc.fullname,a.documentbody from filteredcontact fc inner join filteredannotation a on fc.contactid = a.objectid where fullname = '_test Contact' and documentbody IS NOT NULL
The size of the image is 1812 KB. Thanks for your quick response.
-
Monday, February 11, 2013 11:54 AMModerator
Hello,
Try to execute following query:
select fc.fullname ,a.documentbody ,a.mimetype ,a.filename from filteredcontact fc inner join filteredannotation a on fc.contactid = a.objectid where fullname = '_test Contact' and documentbody IS NOT NULL
And provide following image of results of your query:
- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:24 PM
-
Monday, February 11, 2013 12:04 PM
Hi Andrii,
Query executing perfectly , I am getting some warnings like
Warning 2 [rsInvalidDatabaseImage] The Value expression for the image ‘image1’ did not evaluate to an image. g:\senthil\testreport\testreport\Test Query.rdl 0 0
Warning 1 [rsInvalidExpressionDataType] The Value expression used in image ‘image1’ returned a data type that is not valid. g:\senthil\testreport\testreport\Test Query.rdl 0 0
-
Monday, February 11, 2013 12:07 PMModerator
Dear Senthil,
In case you want to keep me answering please post image I'm asking for. Point.
- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:24 PM
-
Monday, February 11, 2013 12:14 PM
Hi Andrii,
The image is in bigger size so I am unable to attach here. You meant to say that some problem in the image or wat???
File size : 1812 KB
-
Monday, February 11, 2013 12:18 PMModerator
Hi Andrii,
The image is in bigger size so I am unable to attach here. You meant to say that some problem in the image or wat???
File size : 1812 KB
I mean what is the name and mimetype of documents you've got with your query? And how have you registered your image. You have to use following instructions - http://jlattimer.blogspot.in/2012/08/ssrs-report-image-from-crm-note.html
BTW it is impossible but I was able to attach image here... Picasa still exists as well...
Freelance Developer for Dynamics CRM 4.0/2011
- Edited by Andrii ButenkoMVP, Moderator Monday, February 11, 2013 12:19 PM
- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:24 PM
-
Monday, February 11, 2013 12:29 PM
Hi Andrii,
Can you please tell me where to register the image? I haven't register any where.
-
Monday, February 11, 2013 12:33 PMModerator
Recheck following url please - http://jlattimer.blogspot.in/2012/08/ssrs-report-image-from-crm-note.html
Can you please confirm that you've correctly mapped documentbody and mimetype fields as it shown in the article.
- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:24 PM
-
Monday, February 11, 2013 1:26 PM
Hi Andrii,
Thanks for your reply, Please check the below screen shot. Everything is fine but still the image is not viewable.
-
Monday, February 11, 2013 2:10 PMModerator
I believe you are doing something wrong. I was able to make it work.
Here is my query:
Select c.fullname ,(Select top 1 DocumentBody from FilteredAnnotation a where a.objectid = c.contactid) documentbody ,(Select top 1 mimetype from FilteredAnnotation a where a.objectid = c.contactid) mimetype From FilteredContact c Where exists (Select top 1 mimetype from FilteredAnnotation a where a.objectid = c.contactid)
Here is how I add image to report:
Here is rendered report:
Here is url to the report I did - you can download and check it:
Freelance Developer for Dynamics CRM 4.0/2011
- Edited by Andrii ButenkoMVP, Moderator Monday, February 11, 2013 2:11 PM
- Edited by Andrii ButenkoMVP, Moderator Monday, February 11, 2013 2:12 PM
- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:24 PM
-
Tuesday, February 12, 2013 8:36 AM
Hi Andrii,
I have tried with your query, Still I am facing problem to show the image. I have the image in my desktop and type is bmp and I have tried for all types(bmb,gif,jpeg etc) but it is showing the same error. I have checked that mime type(bmp), the field which I have mapped(documentbody) and the source which I have selected("Database"). Once again thnx for ur reply.
Warning 2 [rsInvalidDatabaseImage] The Value expression for the image ‘image1’ did not evaluate to an image. g:\senthil\testreport\testreport\Test Query.rdl 0 0
Warning 1 [rsInvalidExpressionDataType] The Value expression used in image ‘image1’ returned a data type that is not valid. g:\senthil\testreport\testreport\Test Query.rdl 0 0 -
Tuesday, February 12, 2013 9:58 AMModeratorThe image contents is stored as a Base64 encoded string, and you'll have to convert it to a byte array for it to be displayed. The Convert.FromBase64String method will do this conversion
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
-
Tuesday, February 12, 2013 10:56 AM
Hi David,
I have tried that too, still it's showing "x" mark. No images has been shown. Thanks for your reply.
-
Tuesday, February 12, 2013 11:10 AMModerator
Hello,
Could you please upload your report somewhere and provide url to download it?
- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:15 PM
-
Tuesday, February 12, 2013 12:46 PM
Hi Andrii,
Please click the below link to get the report. I have tried with both the query's. Thanks for your reply.
select fc.fullname,a.documentbody from filteredcontact fc inner join filteredannotation a on fc.contactid = a.objectid where fullname = '_test Contact' and documentbody IS NOT NULL
https://skydrive.live.com/#cid=F3892B8FC483A3F8&id=F3892B8FC483A3F8%21109
-
Tuesday, February 12, 2013 12:54 PMModerator
Hi Andrii,
Please click the below link to get the report. I have tried with both the query's. Thanks for your reply.
select fc.fullname,a.documentbody from filteredcontact fc inner join filteredannotation a on fc.contactid = a.objectid where fullname = '_test Contact' and documentbody IS NOT NULL
https://skydrive.live.com/#cid=F3892B8FC483A3F8&id=F3892B8FC483A3F8%21109
Hello,
Not sure what's wrong with your report - I've changed only the mime type from predefined to value from DS and everything worked for me. I've uploaded your report here - https://skydrive.live.com/?cid=F3892B8FC483A3F8&id=F3892B8FC483A3F8!109#cid=F63E4BCD4A7F64A4&id=F63E4BCD4A7F64A4!223
- Proposed As Answer by Andrii ButenkoMVP, Moderator Tuesday, February 12, 2013 1:15 PM
-
Tuesday, February 12, 2013 1:07 PM
Hi Andrii,
Still, It's not working. I think some problem with the server. Anyway thanks for all your help. If you got any idea please do let me know. Once again thanks for all your help.