locked
Substring on Formula field?

    Question

  • Hi,

    I'm developing some reports with vs2005 + C# + Cristal Reports.

    I have a field that i have to format to show in report. The field is string and  it value is something like this:

    '78171300'

    '98547236'

    and i have to show like this:

    '78171-300'

    '98547-236'

    I have a formula field that i want to do like this:

    'CEP: ' & Substring({DATA.Cep}, 1, 5) & ' - ' & Substring({DATA.Cep}, 6, 3)

    but cristal doesn't have a substring function. How can i do that?

     

    thanks.

    Tuesday, November 07, 2006 12:21 AM

Answers

  • Hi Alessandro,

    Try:

     Left ( {?InputString}, 5) & '-' & Right ({?InputString}, 3)

    If you always have 8 characters of input text, then this should provide the same functionality.

          - Dave

    Tuesday, November 21, 2006 12:22 AM
    Moderator

All replies

  • Hi Alessandro,

    Try:

     Left ( {?InputString}, 5) & '-' & Right ({?InputString}, 3)

    If you always have 8 characters of input text, then this should provide the same functionality.

          - Dave

    Tuesday, November 21, 2006 12:22 AM
    Moderator
  • Mid ( {DATA.Cep} ,1 ,5 ) + "-" + Mid ( {DATA.Cep },6 ,3 )
    Monday, November 30, 2009 10:49 AM