For simplicity, let's say my ranges and cells are as follows:
InvoiceLines_TypeItems
----InvoiceLines_TypeItems_Rows
--------InvoiceLines_TypeItems_Rows_Description
--------InvoiceLines_TypeItems_Rows_Quantity
--------InvoiceLines_TypeItems_Rows_NetAmount
----InvoiceLines_TypeItems_TotalAmount
We have 4 invoice itemisation formats, but for simplicity let's say we have 2: all transactions listed (description, quantity, and netamount are taken directly from the model, per line) vs rolled up into categories (description = category, quantity and netamount are summed)
If we duplicate the ranges for each itemisation format and use the Enabled flag to control which range gets printed, it turns out in our performance tracing that everything gets executed anyway, and the Enabled flag merely controls visibility but not ER execution. In our actual format mapping with everything we're printing and the 4 itemisation formats, this is causing invoice printing time to double what it would be if it didn't execute the parts that don't need to be printed.
SO, I need to combine ranges where the display looks the same, and use ER to conditionally bind different things to the same range/cell. Which means the second range, "----InvoiceLines_TypeItems_Rows", needs to bind to different lists because the "all transactions" list and the "grouped by category" list are different. Further on for the child cells (description, quantity, netamount), I need to again bind different things to them conditionally.
This is my formula for the range ----InvoiceLines_TypeItems_Rows:
----InvoiceLines_TypeItems_Rows =
IF(model.InvoiceFormat="Summary",
model.'$ProjectList'.'$Items'.'$LineItems_byCategory',
model.'$ProjectList'.'$Items'.'$LineItems')
I am having difficulty getting this range conditional binding to work (I have no problem with the child cells conditional binding). Has anyone successfully tried to conditionally bind different lists to a Range element in ER format mapping?