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)
leading Blanks in Excel
kik007
Hi,<br />
<br />
i want to create a report for excel. In my dataset i have two columns. In the first one (Level) wich is an integer i have the level for the second (name). For the excel-report i want to put as much blanks before the name as the number of level is. <br />
<br />
For example: level = 3, name = test<br />
output should be:<br />
test<br />
<br />
I thougt it should work with a scripted column like this.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
blank="";
i=row["level"];
while(i>2){
blank +=" ";
i--;
}
blank=blank;
d = row["name"];
d = s + d;
d;
</pre>
<br />
which works fine in the preview but not in excel. <br />
<br />
So in excel there exists the option to place a " ' " (Singlequote) before a text, which will not be shown. This works in Excel also fine, but when i replace the code above with this...<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
...
d = row["name"];
d = "'" + s + d;
d;
</pre>
<br />
Excel show the singlequote. When i go to the cell and press F2 -> Enter the singlequote is not shown anymore. <br />
<br />
So... does someone have an idea how to place the blanks before the text? <br />
<br />
thanks<br />
<br />
ps: forget the "n" in the code selection, seems to be a bug ;-)
Find more posts tagged with
Comments
kik007
Hi again,
i?ve find a solution which seams to be okay, but not the way i wanted to. I put to identic lines in the table. One begins totaly left and the other has a additional column (indent line). For Example. If the level is 1 the indented row will be hide, otherwise (level > 1) the other row will be hide. So i get the ident-effect ;-)
Anyway, if someone has any idea how to realise it with blanks as primary discussed, i will be very happy for any idea.
thanks