IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Alternate background color in dynamic table Options · View
b_verberne
Posted: Tuesday, August 22, 2017 8:20:33 AM
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?
vlad
Posted: Tuesday, August 22, 2017 9:00:43 AM
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
b_verberne
Posted: Tuesday, August 22, 2017 9:02:22 AM
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 advance

File Attachment(s):
Picklist.sps (21kb) downloaded 620 time(s).
Picklist.xsd (20kb) downloaded 701 time(s).
Picklist.xml (67kb) downloaded 604 time(s).


vlad
Posted: Tuesday, August 22, 2017 9:15:08 AM
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() ]
b_verberne
Posted: Tuesday, August 22, 2017 9:26:12 AM
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):
Authentic eForm.png
HTML.png

vlad
Posted: Tuesday, August 22, 2017 10:27:40 AM
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?
b_verberne
Posted: Tuesday, August 22, 2017 10:56:37 AM
Rank: Member

Joined: 8/22/2017
Posts: 13
Location: Netherlands
I'd like the empty line to be filtered out (like the second screenshot)
vlad
Posted: Tuesday, August 22, 2017 12:22:04 PM
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 ) ]
b_verberne
Posted: Tuesday, August 22, 2017 12:32:02 PM
Rank: Member

Joined: 8/22/2017
Posts: 13
Location: Netherlands
Thank you very much!!! You helped me a lot!
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.