Star Power!

I have covered our MSWord shape support in various entries and there are some examples in the documentation. As you know we can change the shapes by skewing them, stretching them, squashing them, etc. We can also repeat them - the last is useful, if say, you want a visual representation of a rating for an employee.

Star1.jpg

As I mentioned, this can be achieved with shapes and that is documented, Jen (who watches our TARs/bugs among other fabulous activities) sent me a variation on the shape repeating. Gif repeating! The customer wanted to use an embedded image rather than a shape and have that repeat - it was a star gif which begged the question 'why not use a shape?' but anyhoo, we aim to please with BIP so here goes.

Some of you that have repeated shapes will be familiar with something like:

<?for-each@shape:xdoxslt:foreach_number($_XDOCTX,0,RATING,1)?>

This code is embedded in the shape to get it to repeat, we want to repeat an embedded image so we can not embed the code, we have to wrap it, so we get some thing like this:

Star2.jpg

A little different, but it generates the correct number of stars. You need to remove the @shape and use the @inlines to get them on a single row and then have the loop start at 1. Remember with shapes you can eliminate the star in the template with the offset but with the gif approach you cant so when RATING =1 we only want a single star so the loop needs to run from '1 to 1' to just get a single star, For rating =3 we get from 1 to 3 ie it adds two more stars to the row. If there is a situation where there should not be an image you will have to get imaginative and wrap an if around the whole thing so that nothing is shown.

If you are interested in the template, you can get it here.

Now people, I covered stars, what other images might you want to repeat on a report, I want business requirements here!

Comments:

Hi I have to create a report with page border. When I give the page border in template, it is not coming while generating report or while doing preview. The output would be PDF. Request you to help me how to do this. Can I use shape i.e. Square Box or something for this requirement ? if yes, how ? Regards, Martand Joshi

Posted by Martand Joshi on January 29, 2009 at 06:49 PM MST #

i dont hav any column as rating which includes numeric value.i cant use the formula given above.i hav a colum of revenue in my database. i want stars in a new column as if revenue>5000 stars shud come in dat correspondin column. revenue >10000 then 4 stars shud come.like this... how can i use stars now.

Posted by pallavi on June 28, 2010 at 12:34 AM MDT #

I hv a table. I hv a field revenue in dat table I want stars in a new column according to the condition such as if revenue<10000 then 3 stars shud come if revenue is in between 10000 and 20000 then 4 stars shud come in dat particular column. The above formula is not working. What shud I do now???

Posted by garima on June 28, 2010 at 04:53 PM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today