Can I put a condition on a group element where it only groups if the selected grouping field is not empty?
Explanation:
Our statement prints each transaction on an invoice as a seperate line. So we’ve grouped these on the @CustTrans_Invoice field to show only one line per invoice. Unfortunately the payment transactions all have this field empty, so now all payments are grouped into one line as well.
I need the grouping to only apply when the field is not empty. Is this possible?
You can apply filtering on the group data, so that only the data that matches the filter, gets into the group. In your scenario, you can set the group filter like this:
I implemented the filtering as you asked. As I understand you now, the criteria need to be extended. You probably know how, so you can try implementing it now. You can combine logical expressions “and” and “or” in the criteria within square brackets.
Hi Albin,
I’m not getting any expression to group only the populated Invoice fields but still display the lines where this field is empty.
This seems to me to need an exclusion and I don’t know how to do that.
I’d like to clarify something first. So, if you apply the expression:
CustTransLines[@CustTrans_Invoice != ‘’]
to the group, in the preview you’ll get the following result, with the PTIN0000001 line, which is expected, as it is the only unique, non-empty value for CustTrans_Invoice.
That expression works as expected yes. I get only the one line for invoice PTIN000001, the payment lines are not printed as it’s excluded in the expression.
I need to expand the expression so the payments, where CustTrans_invoice is empty, show as a list, each one on a separate line, along with the grouped invoice line. And that is where I’m stuck.
As I understood your requirement, you want to have one unique line per each unique @CustTrans_Invoice where it is not empty and then below just list all the lines where @CustTrans_Invoice is empty. If this is correct can you review my output and tell me if this is what you expect to see (for credit and debit fields I just inserted tagging elements and also didn’t include running total for balance)?
Since you want to list records, not only display unique values, you need to introduce a List tagging element. To have this element show records that belong to a group you need to position this tagging element inside the Group tagging element as we will need its context for listing the records. I quickly removed the Group tagging element, inserted one row below, added the Group tagging element and inserted the List tagging element in the empty row below. So far so good.
Now, you want to list only specific records in this List tagging element, this is why you need to use filter in the binding expression:
CustTransLines[@CustTrans_Invoice = '']
This will ensure that only the records are listed with the condition from the square brackets.
There is however one additional thing to consider, right now there is one extra line under the PTIN00000001 line since the Group tagging element is doing its thing and showing us two groups as there are indeed two unique groups grouped by @CustTrans_Invoice field:
@CustTrans_Invoice = 'PTIN00000001'
@CustTrains_Invoice = ''
Now you need a way to hide this second group. If you wanted to apply a filter to the Group then it would mess up the List below as we wouldn’t get the records we need. Instead, since we are displaying a row in the table through the row in the designer, we will apply a condition and hide an entire row if a certain condition is met:
CustTransLines/@CustTrans_Invoice != ''
Do test it out and let us know if you would require any additional information or assistance.
Hi Nicky,
Please preview the report which you used to generate the CustAccountStatementExt.Report (41).ddsp file using output in Word format. Then arrange this Word document as you want to it to be printed. Send us this Word file and we will see how we could design the template to support it.
We found a different work around. It made more sense to change the report dsp to include unique fields for each transaction and design the template around that.