OL Learn

Best way to decide portrait or landscape page output for text data?


My data is text based report data (channel skip), and it can vary in width: 80, 132. 165, 192 column reports. I’m reproducing a v7 form in Connect and was just wondering what the best way to proceed with Connect would be? In v7, PressTalk was used to determine the width of the data by testing for data in different positions. Is this still the best way to proceed, by using conditions in the data mapper to signal the template which section to produce?


You could do it with the same logic as in PP7.

Loop through all your lines in a first loop to get the maximum number of characters on a line and base your Template section orientation on it.

And here is the script for the Line length VS maxChar Action step:

if(data.extract(1,150,0,1,"</br>").length > maxChar){
  maxChar = data.extract(1,150,0,1,"</br.").length;

At the end of this you know what is the maximum number of character for that record.