One of the lesser known and probably even lesser used features we have provided is to support MSWord shape and clipart support ... you know those shapes you use mainly in Powerpoint but sometimes where a simple diagram is needed in Word or you want a goofy piece of clipart in your document.
Its a cool feature but how can you use it in a reporting context? Well the extension of the simple shape support is the ability to manipulate the shapes, you can dulplicate along x and y axes, stretch, skew, rotate, shrink and stretch them ... so what? Well you could think about building your own data visualizations using shapes to build up a 'chart' to represent the data. As an example I have picked on the 'hot' gauge or speedometer ... admittedly more of a BI type object but its a good illustration and will hopefully spark your interest to think of others.
Heres a fairly common sight in reports these days.
Normally requiring a charting engine to render this output ... you can use your RTF template ... you could even develop a set of objects that could be re-used across the organization.
Getting in Shape
Apologies, a poor pun ... but you just need to put together a set of MSWord shapes, data enable them and bind them together as a 'group'. At runtime the shapes are then driven by the incoming data in the case of the gauge the amount of rotation of the arrow and the upper, middle and lower measures. In the attached RTF you can see the gauge object, just ungroup it to see how its made up. The only shapes that are manipulated are the arrow and the text areas for the measures and the grouped shape. We manipulate them by putting the controls into the Web tab of the image properties.
We're using the following XML for demo purposes here:
<speeds>These are pretty well documented in the user guide but I'll explain as I go.
<?shape-rotate:number(.) * 1.8;'c/b'?>- shape-rotate is strangely enough the command to rotate the shape
<?shape-text:$lowVal?>- low, mid and highVal variables are calculated earlier in the template to minimize processing
<?for-each@shape:speed?>The for-each should be familiar, the at shape just tells the engine we're dealing with shapes and looping over the 'speed' group.
So thats the gauge, not that tough to do and with a little time you can build a much better looking gauge than I did but you get the idea. You could even just put in a background image of your choice so you get something more realistic.
Heres the sample and Happy Driving !