|
Rank: Member
Joined: 8/22/2017 Posts: 13 Location: Netherlands
|
I'm searching for a solution to alternate the background color of a table. I've the alternating working with XPATH "if ( position() mod 2 ) then "white" else "navajowhite"" on the "bgcolor" of the table row, however when I use a condition on the table filtering out some values, the alternating isn't working correctly. It seems that the alternating is working on the whole set and not on the filtered values. Has someone an idea how to fix this?
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Can you attach your sample (all files SPS, XML, schema). It will be easier to show you how-to
|
|
Rank: Member
Joined: 8/22/2017 Posts: 13 Location: Netherlands
|
vlad wrote:Can you attach your sample (all files SPS, XML, schema). It will be easier to show you how-to
I'll add the files, thanks in advanceFile Attachment(s): Picklist.sps (21kb) downloaded 620 time(s). Picklist.xsd (20kb) downloaded 701 time(s). Picklist.xml (67kb) downloaded 604 time(s).
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
The easiest would be to remove conditional processing, and change the parent template instead:
( MaterialWorkInstruction | TextWorkInstruction | AdditionalWorkInstruction | QualityWorkInstruction )[ IsPickList = true() ]
|
|
Rank: Member
Joined: 8/22/2017 Posts: 13 Location: Netherlands
|
vlad wrote:The easiest would be to remove conditional processing, and change the parent template instead:
( MaterialWorkInstruction | TextWorkInstruction | AdditionalWorkInstruction | QualityWorkInstruction )[ IsPickList = true() ]
I changed the parent template and I think I'm almost there. In the example line 2 and 3 are still shown in the same color, probably related to an empty line that will be filtered. When I preview with 'Authentic eForm' I see the empty line, when I preview in HTML or PDF the empty line is not shown (that's what I want), but in that case the 2 lines are in the same color.
b_verberne attached the following image(s):
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Do you want this empty line to be there or to be filtered out?
|
|
Rank: Member
Joined: 8/22/2017 Posts: 13 Location: Netherlands
|
I'd like the empty line to be filtered out (like the second screenshot)
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Then you need to extend your XPath statement to only keep the non-empty lines
( MaterialWorkInstruction | TextWorkInstruction | AdditionalWorkInstruction | QualityWorkInstruction )[ IsPickList = true() and ( MaterialDescription or AdditionalText ) ]
|
|
Rank: Member
Joined: 8/22/2017 Posts: 13 Location: Netherlands
|
Thank you very much!!! You helped me a lot!
|
|
guest |