Record/Text overflow to the next page

Have a parts table where each part contains 4 lines.
In one of the line I have a serial number.
The serial numbers are just a long text line from datamapper, where each line is split by a @
Each serial number needs to be on a single line under the part.

Is there a way to get the idividual part line to break into a new page.
In my case the serials just keep comming down the page. Through the bottom note an header on the next page. It keeps the record together.


Script for splitting the long text line into serials.:
var InvStatus = this.record.fields[‘InvStatus’];
//var InvStatus = ‘Batch number : 19-08-30967@Batch number : 19-11-31350@’;
var Text1 = ‘’, SerBatNo = ‘’, Text2 = ‘’;
var CurrentLine = ‘’;
var LineCount = 0;

// Count number of lines - line ends with @
for (var i = 0; i < InvStatus.length; i++) {
if(InvStatus.charAt(i) == ‘@’)
LineCount++;
}

// Split lines into single lines
for (var i = 0; i < LineCount; i++){
CurrentLine = InvStatus.split(‘@’)[i];

// Check for batch + serial number
if (CurrentLine.indexOf("Batch") != -1) Text1 = '<b class="DarkBlue"><b>Batch No.: </b>';

else if (CurrentLine.indexOf("Serial") != -1 )Text1 = '<b class="DarkBlue"><b>Serial No.: </b>';
else Text1 = '';
Text2 = CurrentLine.split(':')[CurrentLine.split(":").length-1];
Text2 = Text2.trim();
SerBatNo += Text1 + '<b class="BlackNormal">' + Text2 +  '<br/>'; 

}
this.html(SerBatNo);

Orginal file setup:
image

Don’t know if it would help anything it the serials where in another detailed table in the datamapper or it would give the same problem.
image

If you do the splitting in the Datamapper and end-up with the serials in a detail table, then the overflowing will be handled by Connect inner ability to do it.

the way you ar doing it right now is adding a lot of lines inside a single cell which causes the overflowing mechanism to not know what to do with that specific cell.

In a detail table, each serial would have its own row.

It works when the text is in a detalid table in a seperate table row.
But it gives me another chalange
Before I had a description field and the serial at the same line…
I sit posible to have that when they are not in the same data-repeat ?
There is always only one description, but there can be multiple serials.

    <!--Line1-->
    <tr data-repeat="Parts">
        <td colspan="2" data-script="Description" style="text-align: left;">@Description</td>
        <td colspan="2"></td>
    </tr>
    <!--Line2-->
    <tr data-repeat="Parts.InvStatus">
        <td colspan="2"></td>
        <td colspan="2" data-script="InvStatus" style="text-align: left;">@InvStatus@</td>
    </tr>

image

Hi @klaus.soerensen,

I assume that you would like to have the following HTML code as result?

<table cellpadding="0" cellspacing="0" style="width: 100%;">
    <tbody>
        <tr>
            <td colspan="2" rowspan="4" style="vertical-align: top;">Description A</td>
            <td colspan="2">Serial Number : 001</td>
        </tr>
        <tr>
            <td colspan="2">Serial Number : 002</td>
        </tr>
        <tr>
            <td colspan="2">Serial Number : 003</td>
        </tr>
        <tr>
            <td colspan="2">Serial Number : 004</td>
        </tr>
    </tbody>
</table>

If so, then I assume that you will have to create these HTML elements – at least the TR- and TD-elements – by a Standard Script.

Could you share a anonymized version of your Template and Datamapper? There is something I would like to try. Or you can send me the package vis a personnal message.

I suggest to add a class to the table data element holding the serial and create a script to iterate over these using the “Each matched element”-scope in the script options. In the script you can fetch some information from the parent element (the row), this includes information on the detail table data used for this row (stored in the data-group-reference attribute). Use this info to determine the record index.

Below my html, script and sample output.

Perhaps this is of some help.

Erik

image

<table id="table" class="table--minimalist" data-detail="" style="width :100%" data-expander="2019">
<thead>
    <tr>
        <th text-align: left;">Description</th>
    </tr>
</thead>
<tbody>
    <tr data-repeat="Parts.Status">
        <td>@description@</td>
        <td class="serial" data-field="serial">@serial@</td>
    </tr>
</tbody>