Display of unique values in multiple columns

Hello! I am trying to display unique values of data fields (e.g., packing slip numbers) in multiple columns in one of my reports.

I edited one of your replica templates to display packing slip numbers (highlighted in red) on the line level:

I have successfully implemented this multi-column layout by setting the table cell rendering mode in the list tagging element properties (see test Table 1 below).

However, when I tried to apply the same settings to the group tagging element (Table 2), I could not select the table cell rendering option in the group properties (i.e., the rendering mode property is not available for the group):

For this reason, I can apparently only display unique values vertically (see Table 2 above, while Table 3 was just another attempt to do this).

I have attached a sample template to show what I am trying to accomplish. Specifically, I want to display only the unique packing slip numbers in columns 1-5:

Can you help me achieve this?

SalesInvoice.Report_rendering of unique field values in multiple columns.docx (95.2 KB)

Hi Michael,

Unfortunately, the simplest solution for your needs, which is to select the table cell rendering mode on the Group tagging element, is not currently supported.

We have this feature on our roadmap, and Docentric will support the rendering mode for the Group tagging element in one of the future versions of Docentric Designer.

However, there is a simple workaround that you can implement in your template to achieve precisely the results you want. Let me describe the approach and the steps required:

  1. Convert the unique packing slip values to a concatenated string;

  2. The new string must concatenate unique packing slip values separated by a delimiter. I used a line feed, but you can also use a semicolon, comma, or any other character you never use for packing slip numbering;

  3. Use the generated string of unique packing slips (from the ps-string Var tagging element) in the Xpath expression for the List tagging element. Combined with the string-split function which converts the ps-string string back into its subsets (i.e., the unique packing slip numbers), we now can use the List tagging element (instead of a Group) and keep the Table Cell rendering mode.

  4. Voila, the result!

Solution details

I removed the Main table and Table 3 from the attached test template to quickly preview the results.

You already used the Var tagging element in the original version of the template to count unique packing slip values. Note that there is now a second variable named ps-string in the same Group: it concatenates the group keys and adds a line feed between them. Below is the XPath expression I used:

concat(@docentricdg:Key, $lf, var-element-value(‘ps-string’))

We can then use the same variable value in the XPath expression of the List tagging element:

string-split(var-element-value(‘ps-string’), true(), $lf)

The value of the ps-string variable is now converted back into its subsets - unique packing slip numbers - using the string-split function. Please note that I am using the same $lf delimiter (the linefeed) as in the ps-string variable:

Next, the child Field tagging element inside the List was previously bound to the @PackingSlip data field. But, because we changed the binding of the List tagging element, we also need to change the binding (XPath expression) of the Field.

It may sound strange, but it is enough to remove (delete) the existing Xpath expression and leave the Path dialog box empty.

image

As the Binding source of this field points to Data Context, this is what we now see in the template:

The abovementioned changes will result in the expected output of unique packing slip numbers rendered in multiple columns.

Here is the edited version of the template:
SalesInvoice.Report_rendering of unique field values in multiple columns_edit.docx (91.2 KB)

Please let me know if you need more information about the expressions used, the logic, or the structure of the elements.