In this webinar, our experts showcase a variety of demo use cases of how different components of the...
PowerPhoto is one of the usability add-ons developed by PowerObjects. One of the cool features of this add-on is that it is built within CRM using Custom Entities and a Custom Silverlight page - The photo itself is stored (encoded) in a database field. Now, let us see how we can use these images in custom reports.
This example uses FetchXML source which makes it CRM 2011 Online supported. Here is a quick introduction to FetchXML based custom reports for CRM 2011. After following the instructions to create the Data Source to the corresponding CRM 2011 Organization, you would add your FetchXML Query as shown in the screenshot below:
Here is the code for the Fetch Query
This example demonstrates getting fields on the product record along with the photo associated with the product (You can add more attributes and filter conditions as necessary). The Key for this query is the link-entity statement which joins the Product table to the PowerPhoto table which stores the photos related to all entities. Another one is the condition inside the link-entity which filters the entity type to only products.
After creating the dataset, you can use it in your report definition and have an image control to hold the Photo for a given record. The main properties that you need to set for the image control are shown in the screen shot below:
This will convert the encoded string to the required format for the image control. Now you can preview the report and upload the report to CRM using the report RDL file. This is the how the report looks in CRM.
On-premise and partner-hosted clients can create SQL query based reports as well in addition to the FetchXML based reports and po_PowerPhoto is the entity that should be used to get the Photo file. In this way, you can create more complex reports according to your business requirements.
Please note: CRM Online users may experience less than optimal results due to a character limitation.
We originally built PowerPhoto to allow people to drop images of people in the contact or lead record….but as with anything in this great community people started doing other things with it and reports have come up a number of times. So yes the images can be used in reports and we hope this walked you through how to do it. If you still need more assistance please reach out to the CRM Experts at PowerObjects and we will lend a hand!
Happy CRM'ing
What does "less than optimal results" mean for CRM Online users?
Hi - CRM online has a character limitation so it will only render super super small images......this is a restrictions in the srs sandboxing that is used in crm online. We hope that it will be lifted in the near future.
Im trying to use PowerPhoto to include product images in reports in my custom report for CRM Online. My problem is that the images will not render in the report viewer. Instead the viewer will stop responding. Any ideas what might be wrong?
As i edit the report in VS 2010 it renders fine. Also, if I open the report in the report-viewer and the first page does not contain any images I am able to export the report to PDF and images will appear on subsequent pages in the pdf file.
Is the character limitation gone in the current release?
Problem solved. The problem was caused by records with no images where the Fields!photofile.Value
was "null". I managed to solve it by replacing the null value like this
System.Convert.FromBase64String(Microsoft.VisualBasic.Interaction.IIf(Microsoft.VisualBasic.Information.IsNothing(Fields!photofile.Value), "...base64 encoded default image...", Fields!photofile.Value))