Start a new topic

shade alternate rows when printing template

I am trying to get a quote with multiple items to print out with alternate lines shaded, just like in MS Excel example below

  

image


 

 

The pic below is of "Detail Section 1" from a QW standard template.   Will I have to code something like excel into QW "Detail Section 3" ?  If so, how would that be coded?


 

image


1 person has this question

This is very fiddly, I gave up last time I looked.

I'll have another little look.

This is the best I can come up with, which seems to behave as you've outlined.


It involves two detail sections, for the same type of line.


At the end of your formula you need to add something like:

.and.(documentitems->&linenumber=text("1").or.

documentitems->&linenumber=text("5").or.

documentitems->&linenumber=text("7").or.

documentitems->&linenumber=text("9").or.

documentitems->&linenumber=text("3"))


With the other filter being even numbers. You'd need to add as many as you'd typically get to in a quote.




image


In the absence of a modulus operator to follow this logic on a document with more than 10 lines, you  

(last(text(documentitems->&linenumber), 1)=("1")
.or.last(text(documentitems->&linenumber), 1)=("3")
.or.last(text(documentitems->&linenumber), 1)=("5")
.or.last(text(documentitems->&linenumber), 1)=("7")
.or.last(text(documentitems->&linenumber), 1)=("9"))

 


1 person likes this

Has anyone tried this?  Convert the line number to a number (it's stored as text); then divide by 2, convert back to a string with 1 digit, then find the last digit.

Any odd number will return a 5; any even number would return a 0


Here's the formula

last((totext((tonumber((documentitems->&linenumber))/2)),1),1)


As this is quite a few years old now, is there an easier solution now?


It does seem odd that it's not a built-in option.

No change. 


Very fiddly, but possible as detailed above.

What if you were to use a script to number document lines that are printed so you can alternate them with filters in that way? 

Login or Signup to post a comment