I knew I had jumped the gun ... the devil is in the detail as it were - Bill followed up yesterday on the forum with a little more detail on what was needed.
Thank you for your fast response, actually I should have made my question clearer. Let's take your sample data, what I need is like this:
For group 1 Nuts and Bolts Limited, make background yellow,
981110 10-NOV-04 Standard EUR 122
100000 28-MAY-04 Standard FIM 122
100001 28-MAY-04 Standard FIM 200
1 03-JUN-04 Standard FIM 400
100004 28-MAY-04 Standard FIM 100
00s 07-JUN-04 Standard FIM 100
FI1009 10-MAY-04 Standard FIM 1220
Stop make background yellow.
For group 2 Tick Tock Clocks, make background blue,
100002 28-MAY-04 Standard DEM 235
100003 28-MAY-04 Standard DEM 100
2001 01-JUN-04 Standard EUR 1000
2002 01-JUN-04 Standard EUR 1500
2003 01-JUN-04 Standard DEM 1000
2004 01-JUN-04 Standard DEM 2000
3001 04-JUN-04 Standard EUR 1000
FI1011 25-MAY-04 Standard DEM 2000
Stop make background blue.
For group 3, make background back to yellow
Big Bike Motorsports
3001 01-JUN-04 Standard SEK 1000
FI1013 02-JUN-04 Standard USD 25000
Stop make background back to yellow
For group 4, make background back to blue
Second Cars
FI1010 20-MAY-04 Standard FIM 2440
Stop make background back to blue
We're mixing 'Groups' and 'records' here, in my original post I colored fonts and backgrounds based on the group or 'for-each'. What Bill is decribing above is to alternate the coloring of records within a group. Still doable, still not 'disappearing an elephant' but maybe 'pulling a bunch of flowers out of your sleeve' - OK OK I'll stop with the magician analogies.
Heres the template, looks similar to the ones from yesterday but without the shading.

The only addition is the IFColor field - inside there is some code to manipulate the table fill color based of some boolean expression.
<?choose:?>
<?when:position() mod 2=0?>
<?attribute@incontext:background-color;'Yellow'?>
<?end when?>
<?otherwise:?>
<?attribute@incontext:background-color;'Red'?>
<?end otherwise?>
<?end choose?>
This relies on the position() and 'mod' functions to allow us to, in this case alternate between two colors we can increase the mod value to alternate between more if we wish. If you are going to stick with just 2 then we can simplify further.

Just set a color background on the table and in the formfield use:
<?if:position() mod 2=0?><?attribute@incontext:background-color;'Red'?><?end if?>
So by default the color will be yellow but when the 'mod' condition is satified ie every even row you'll get a red background. Of course standard HTML color names are supported along with RGB HEX values.
Comments (2)
Hi Tim,
I am generating some RTF letters using XMLP. These letters have some text which gets edited by user after generation of letter. For this, I need a functionality which will catch user's attention to such text in letter.
In old system this was achieved by displaying such text in Form Fields. Then user has to just press F11 which takes him through all form fields.
Can you please suggest me a way to have form fields in RTF output generated by XMLP? or is there any alternative to grab user's attention to such text?
If alternative of highlighting background color is considered, then it appears in printing. So please let me know if you have any solution for this.
Thanks in advance.
Regards,
Manjiri
Posted by manjiri | August 26, 2008 8:07 AM
Posted on August 26, 2008 08:07
Hi Manjiri
We do not preserve the formfields in our RTF output right now.
You could highlight the background of areas that need to be filled out. then you have the problem of removing the highlights before printing. for this the user could have a macro in their copy of Word. Before you ask, you can not embed macros in your RTF templates - MS does not allow it in the RTF spec. So, it would need to be a macro installed in the Normal.dot template in Word on the users machine that they would execute on exiting or you could attach it to the Save or Close event in Word to automate it.
Tim
Posted by Tim | August 27, 2008 12:21 PM
Posted on August 27, 2008 12:21