PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 25 → windev 21 - relatório com formatação condicional
windev 21 - relatório com formatação condicional
Iniciado por Mister ANDRE MARTINI, out., 13 2016 6:54 PM - 3 respostas
Membro registado
208 mensagems
Popularité : +25 (25 votes)
Publicado em outubro, 13 2016 - 6:54 PM
Pessoal,

como faço para colocar uma condição num relatório, quando for pessoa física imprime o CPF e não imprime o CNPJ e quando for pessoal jurídica imprime o CNPJ e não imprime o CPF (são campos diferentes na base de dados)?


No crystal reports em uma opção "Suprimir Se", se a condição for verdadeira não imprime e se for falso imprime.

--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Membro registado
208 mensagems
Popularité : +25 (25 votes)
Publicado em outubro, 18 2016 - 2:42 PM
Consegui resolver ...

reading the Data RPT_

IF MySource.Tipo_pessoa = "JURÍDICA" THEN
STC_Cnpj_cliente..Caption = "CNPJ"
ITEM_Cnpj..Visible = True
ELSE
STC_Cnpj_cliente..Caption = "CPF"
ITEM_Cnpj..Visible = False
END


Windev 21 - Relatório Suprimir Campo


--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Membro registado
208 mensagems
Popularité : +25 (25 votes)
Publicado em outubro, 18 2016 - 2:43 PM
existe também a opção de mudar o conteúdo de um item do relatório (1 item para duas informações)

IF MySource.Tipo_pessoa = "JURÍDICA" THEN
STC_Cnpj_cliente..Caption = "CNPJ"
ITEM_Cnpj..DisplayedItem = "Cnpj"
ELSE
STC_Cnpj_cliente..Caption = "CPF"
ITEM_Cnpj..DisplayedItem = "Cpf"
END


--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html
Membro registado
208 mensagems
Popularité : +25 (25 votes)
Publicado em outubro, 19 2016 - 9:31 PM
só uma correção, não é a propriedade DisplayedItem, veja o código abaixo para mudar a informação de um item do relatório
IF MySource.Descricao_alternativa <> "" THEN
ITEM_Descricao_do_produto = MySource.Descricao_alternativa // imprime a descrição alternativa
ELSE
IF MySource.Codigo_do_produto > 0 THEN
ITEM_Descricao_do_produto = MySource.Descricao_do_produto // imprime a descrição do produto
ELSE //serviço
ITEM_Descricao_do_produto = MySource.Descricao_do_servico // imprime a descrição do serviço
END
END


--
André Martini
IS2 Automotive http://www.is2.inf.br/is2automotive/index.html
IS2 Construtive http://www.is2.inf.br/is2construtive/index.html
IS2 Store http://www.is2.inf.br/is2store/index.html
IS2 Gerent http://www.is2.inf.br/is2gerent/index.html