PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → windev 21 - relatório com formatação condicional
windev 21 - relatório com formatação condicional
Débuté par Mister ANDRE MARTINI, 13 oct. 2016 18:54 - 3 réponses
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 13 octobre 2016 - 18:54
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
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 18 octobre 2016 - 14:42
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
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 18 octobre 2016 - 14:43
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
Membre enregistré
212 messages
Popularité : +25 (25 votes)
Posté le 19 octobre 2016 - 21:31
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