Skip to main content

Have you seen this (very old) article about the attribute?

https://groups.google.com/forum/#!topic/fmetalk/P5Wlan332Po

It appears to be a Reader only attribute, that does not influence the output.


Yes, I actually saw this article yesterday.

I found that if you don't use the attribute (igds_text_num_lines), then multi-line text will translate, but the size and width become distorted. If you use the attribute and input a numeric value greater than 1, it does influence the output. For example, I gave the attribute a value of 2. When I exported text containing two lines, the output was good - it was 2 lines with the correct size and width. However, text with 1, 3, 4, or more lines does not translate well. Using a numeric value works well when the text you are exporting always has the same number of lines. I was hoping some type of variable might resolve the issue.

Thank you for your response.


I tried something, you might try too:

You can calculate the number of lines by calculating the StringLength of the text minus the StringLength of the text after replacing the new-lines.

This would be the formula to use in the AttributeCrator if your text attribute is Text:

@StringLength(@Value(Text)) - @StringLength(@ReplaceString(@Value(Text),\\n))

Then you can use this "Number of lines" as igds_text_num_lines


Thanks, I'll give it a try!


It doesn't like the formula. After looking at it, I'm not sure it would work the way I want in my case because the text I am bringing over isn't necessarily divided into more than one line by the number of characters. The number of lines in the original text is based on the population of field values and is hard coded based on that in the source system. On the other hand, we do export some notes text that this may work for. I would first have to get the attributecreator to accept the formula. Thanks.


It doesn't like the formula. After looking at it, I'm not sure it would work the way I want in my case because the text I am bringing over isn't necessarily divided into more than one line by the number of characters. The number of lines in the original text is based on the population of field values and is hard coded based on that in the source system. On the other hand, we do export some notes text that this may work for. I would first have to get the attributecreator to accept the formula. Thanks.

You could also use a StringReplacer to remove the NewLine before the second count and then use two StringLengthCalculator transformers to do the math.

 

 


Reply