Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Inserting spaces at the beginning of a data element
slievain
I would like to dynamically insert spaces at the beginning of a data element functions of a datasetrow value. Here is the code I inserted in the function of a data element :<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var result = "";
for(i = 0; i < dataSetRow["indentNb"]; i++) {
result += " ";
}
result += dataSetRow["Name"];
result;
</pre>
<br />
The Name is correctly displayed but the spaces have been deleted.<br />
Is there a function like "trim" applied to label content?
Find more posts tagged with
Comments
mwilliams
slievain,<br />
<br />
This should work for you in a text box with type HTML selected in place of the data element.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<VALUE-OF>var result = "";
for(i = 0; i < row["indentNb"]; i++) {
result += " ";
}
result += row["Name"];
result;</VALUE-OF>
</pre>
slievain
it works fine!!
thank you
mwilliams
No problem. Let us know whenever you have questions.