Results 1 to 3 of 3

Thread: Formatar Cep

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Formatar Cep

    Como formatar o Cep em um relatório feito no Dataflex reports.

    Fiz assim, mas não deu certo, retornou "0"

    Let scep = Len({Clientes.cep})

    if (sCep = 9) then

    Let sCep1 = Mid({Clientes.cep),1,5,})
    Let sCep2 =Mid({Clientes.pef(,6,3,})


    let sCep = sCep1 + ." _" + sCep2

    Return sCep

    End

  2. #2
    Join Date
    Jul 2010
    Location
    São Paulo/Brazil
    Posts
    172

    Default Re: Formatar Cep

    Quote Originally Posted by Benedito View Post
    Como formatar o Cep em um relatório feito no Dataflex reports.

    Fiz assim, mas não deu certo, retornou "0"

    Let scep = Len({Clientes.cep})

    if (sCep = 9) then

    Let sCep1 = Mid({Clientes.cep),1,5,})
    Let sCep2 =Mid({Clientes.pef(,6,3,})


    let sCep = sCep1 + ." _" + sCep2

    Return sCep

    End
    Benedito,

    Crie um campo formula e coloque o seguinte:
    Picture ({TABELA.CAMPO},"XXXXX-XXX")

    Fernando
    Fernando Henrique Chacur de Faria
    Sao Paulo/SP - Brazil

    E-mail: fernandochacurdefaria@gmail.com
    Celular/WhatsApp: (11) 98443-8580
    VDF Telegram Group PT/BR: https://t.me/VDF_PTBR

  3. #3
    Join Date
    Jun 2010
    Location
    São Paulo - Brazil
    Posts
    22

    Default Re: Formatar Cep

    Olá.
    Tente o seguinte:

    let sCEP = {cliente.CEP_NUM}
    let iTam = (8-len(sCEP))
    let sCompl = ""
    if (iTam > 0) then
    let sCompl = (String(iTam,"0"))
    let sCEP = cStr(sCompl) + cStr(sCEP)
    end
    let sCEP1 = (Left(sCEP,5))
    let sCEP2 = (Right(sCEP,3))
    return sCEP1 + "-" + sCEP2



    Deve funcionar tanto para campos numéricos como alfanuméricos.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •