Environment: IllDataprovider, dbf tables with ntx indexes
I’m creating a report printing invoices.
There is a 1:n relation from invoices to invoice items. The item table has an index with the key rngnr + posnr. This automatically sorts the items ascending by line item number (posnr). Now I want to define sort orders allowing the user to pick between ascending and descending line item numbers. Hence I define two sort orders and get the correct :ApplySortOrder calls. Works great. Unfortunately now there are three sort orders the user can pick when right clicking the line item number field: “Ascending”, “Descending” and the default “Unsorted”. Is there a way to get rid of the “Unsorted” option which is in fact identical with my “Ascending” option?
Thanks for your question. This is likely the default order, which happens to be “Ascending” in your case, but I can see how the “Unsorted” option could be a bit confusing since it’s acting like “Ascending”.
To help us better understand the situation and give you the best possible solution, would you mind sharing your implementation of the data provider? That way, we can take a closer look at how the sorting is set up and pinpoint where things might be going awry.
I don’t mind sharing my ILLDataProvider implementation but posting it here is no good idea because of it’s sheer size. And it won’t help at all, because it does not matter.
Hence I’ll rephrase. When you define two sort orders, in my case ascending or descending by line item number, L&L will allow you to pick from three sort orders, in my case:
“ “
“Nach Positionsnummer aufsteigend”
“Nach Positionsnummer absteigend.”
All I ask for is get rid of that first empty menu entry which looks odd and is identical with #2.
This is how I define sort orders in my implementation:
* Allow different sequences
posWorkArea:AddSortOrder("Position [+]","Nach Positionsnummer aufsteigend") && That's the default sequence
posWorkArea:AddSortOrder("Position [-]","Nach Positionsnummer absteigend",{"-posnr"})
The default index is used for ascending order, an extra index is created for the descending order.
You might have to know, that when working with a dbf/ntx combination, table access is done via an index file that makes the data file appear to have the sequence defined by the index key used. In my case the item file is index by invoice number + lineItemNumber (=posnr).
In List & Label, whenever you define sort orders for a table, the Designer will always offer your sort orders plus the built-in default “unsorted” choice. We’ve double-checked this behavior with our engineering team to be sure, and I’m sorry to say that there’s no supported way to suppress that entry at the moment.
If you need the default to match “ascending”, perhaps keep just your custom “Nach Positionsnummer absteigend” and rely on the default Unsorted for ascending. That leaves exactly two meaningful choices in the context menu.