POWEROBJECTS

718 Washington Ave. N. Suite #101
Minneapolis, MN 55401
View map and all Locations

Send us a message

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.

addons

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

<?xml version=”1.0″?>

<fetch distinct=”false” mapping=”logical” output-format=”xml-platform” version=”1.0″>

<entity name=”product”>

<attribute name=”name”/>

<attribute name=”quantityonhand”/>

<order descending=”false” attribute=”name”/>

<link-entity name=’po_powerphoto’ from=’po_oid’ to=’productid’ link-type=’outer’>

<attribute name=’po_image’ alias=’photofile’ />

<filter type=’and’>

<condition attribute=’po_typename’ operator=’eq’ value=’product’ />

</filter>

</link-entity>

</entity>

</fetch>

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.

<link-entity name=’po_powerphoto’ from=’po_oid’ to=’productid’ link-type=’outer’>

<attribute name=’po_image’ alias=’photofile’ />

<filter type=’and’>

<condition attribute=’po_typename’ operator=’eq’ value=’product’ />

</filter>

</link-entity>

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

Avatar for JoeCRM

JoeCRM

Joe CRM is a CRM superhero who runs on pure Microsoft Dynamics CRM adrenaline. As the face of PowerObjects, Joe CRM’s mission is to reveal innovative ways to use Dynamics CRM and bring the application to more businesses and organizations around the world.