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)
TOC with PageNumber and dots...
Donbolcze
<p>Hi,</p><p> </p><p>i have a problem in creating printable TOC with dots.</p><p> </p><p>I have a table with two cels :</p><p>_____________________________</p><p>|Title | Page| </p><p>|_____________|_______________|</p><p> </p><p>Title and Page are Labels but it can also be dynamictext.</p><p> </p><p>i achieved goal without dots, but i would like to make my TOC will be like </p><p> </p><p>________________________________</p><p>|Title...........................................|....Page|</p><p>|This is long title.........................|....Page|</p><p>|_________________________|______|</p><div> </div><div>my table is 100% width, cells are 90% and 10% widht.</div><div> </div><div>How can i check textbox,label or etc lenght and fill it with dots - lenght of string ?</div><div> </div><div>Can someone help? </div><div> </div><div>Thanks in advance...</div><p> </p>
Find more posts tagged with
Comments
micajblock
<p>I am not sure this is the best option but attached is a design that shows how one can do this. I am using a JavaScript trick to repeat the dots</p><pre class="_prettyXprint">Array(1000).join(".")</pre><p>For the trailing dots all you need to do is set the Whitespace property to no wrapping. for the leading dots you might need to set the number of the dots based on the the length of the page number (I have it set to 18).</p><p> </p><p>I hope this helps.</p>
Donbolcze
<p>Thank you mblock! This is the result what i expect.</p><p> </p><p>I have one more question... What if my Title will be so long that it will be displayed in two lines ? Is there any java trick to check that text is displayed in two lines ? </p><p> </p><p>Sorry for my questions, but i'm not a programmer.</p><p> </p><p>Thanks in advance, </p>
Donbolcze
<p>any ideas ? </p>
micajblock
<p>Not yet. Been busy.</p>
micajblock
<p>After further investigation anything beyond the solution I provided will require the use of the Java FontMetrics class. This will require you to include the class in some script and use the FontMetrics class to calculate how many '.' you need to add to the end of the string. I do not have a detailed example.</p>