Click here to Skip to main content
13,146,395 members (48,217 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi everyone
I need to justify a paragraph like what Microsoft Word does.
Word Justfy options are: justify, justify low, justify medium, justify high
I found TextAlign in RDLC but it does not solve my issue.
any suggestion would be appreciated.

Regards Jamal
Posted 29-May-11 23:54pm
Updated 5-Sep-16 7:25am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi,

This is not available in reporting services. There is only Left, Center and Right.

Default & General dont do anything..

Nothing can we do.. If possible let me know..
Thanks,
  Permalink  
Comments
sjms 30-May-11 9:16am
   
thanks for answering me.
I have not found anything so far.
But I realy need to do that , i am searching for a way to simulate it.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

AFAIK there is no option for that in RDLC.
Try this alternative
SQL Reporting Services Justify text in a textbox[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

I just create a function that returns a list of strings, but you hace to use a monospace font like "Courier".

        public static List<string> GetText(string text, int width)
        {
            string[] palabras = text.Split(' ');
            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            int length = palabras.Length;
            List<string> resultado = new List<string>();
            for (int i = 0; i < length; i++)
            {
                sb1.AppendFormat("{0} ", palabras[i]);
                if (sb1.ToString().Length > width)
                {
                    resultado.Add(sb2.ToString());
                    sb1 = new StringBuilder();
                    sb2 = new StringBuilder();
                    i--;
                }
                else
                {
                    sb2.AppendFormat("{0} ", palabras[i]);
                }
            }
            resultado.Add(sb2.ToString());
 
            List<string> resultado2 = new List<string>();
            string temp;
 
            int index1, index2, salto;
            string target;
            int limite = resultado.Count;
            foreach (var item in resultado)
            {
                target = " ";
                temp = item.ToString().Trim();
                index1 = 0; index2 = 0; salto = 2;
 
                if (limite <= 1)
                {
                    resultado2.Add(temp);
                    break;
                }
                while (temp.Length <= width)
                {
                    if (temp.IndexOf(target, index2) < 0)
                    {
                        index1 = 0; index2 = 0;
                        target = target + " ";
                        salto++;
                    }
                    index1 = temp.IndexOf(target, index2);
                    temp = temp.Insert(temp.IndexOf(target, index2), " ");
                    index2 = index1 + salto;
 
                }
                limite--;
                resultado2.Add(temp);
            }
            return resultado2;
        }
 
</string></string></string></string></string>


Hope it helps!
  Permalink  
Comments
Dave Kreskowiak 5-Sep-16 14:56pm
   
Don't drop answers on FIVE YEAR OLD questions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 5 Sep 2016
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100