Fórum QuickReport imprimir um valor dependedo de uma condição #244273
24/07/2004
0
Ex. se campo1 = semestral, qrlabel1 = 30,00
se campo1 = anual, qrlabel1 = 50,00
se campo1 = outros, qrlabel1 = 60,00
Grato, Adriano
Xadriano
Curtir tópico
+ 0Posts
24/07/2004
Zottis
Ex:
procedure TFrmBaixas.BitBtn1Click(Sender: TObject);
const
Periodo = ´De ´´¬s´´ Até ´´¬s´´´;
begin
//ImprimirCtasvencidas é o form a ser impresso.
Application.CreateForm(TImprimirCtasvencidas,ImprimirCtasvencidas);
if RadioGroup1.ItemIndex = 0 then
begin
ImprimirCtasvencidas.QRlabel3.caption:=´Todos(Pagas e Abertas)´;
end;
if RadioGroup1.ItemIndex = 1 then
begin
ImprimirCtasvencidas.QRlabel3.caption:=´Liquidadas´;
end;
if RadioGroup1.ItemIndex = 2 then
begin
ImprimirCtasvencidas.QRlabel3.caption:=´Não Pagas´;
end;
ImprimirCtasvencidas.Periodolabel.caption :=
Format(Periodo, [DateToStr(Data1.date), DateToStr(Data2.date)]);
ImprimirCtasvencidas.Preview;
ImprimirCtasvencidas.free;
end;
espero que te ajude.
Gostei + 0
24/07/2004
Xadriano
Se o aluno for do curso anual valor do qrlabel = 30,00
Se o aluno for do curso semestral valor do qrlabel = 50,00
se for de outro curso qr label = 60,00
Ficarei muito grato se puderes me ajudar,
Adriano
Gostei + 0
24/07/2004
Zottis
é só passar a condição e jogar no QRlabel.
if Se o alunoCurso.value = ´anual´ then
begin
FormImpressao.QRlabel3.caption:=´R$30,00´;
end else
if Se o alunoCurso.value = ´semestral´ then
begin
FormImpressao.QRlabel3.caption:=´R$50,00´;
end else
if Se o alunoCurso.value = ´Outro´ then
begin
FormImpressao.QRlabel3.caption:=´R$60,00´;
end;
Gostei + 0
24/07/2004
Xadriano
eu fiz desta maneira no evento onpreview:
procedure TFrmPrint.QuickRep1Preview(Sender: TObject);
begin
if Datamodule2.ADOQueryGeralCURSO.Value = ´Anual´ then
begin
Qrlabel137.Caption:=´R$ 30,00´;
End else
if Datamodule2.ADOQueryGeralCURSO.Value = ´Semestral´ then
begin
qrlabel137.Caption:=´R$ 50,00´;
End Else
if Datamodule2.ADOQueryGeralCURSO.Value = ´E.J.A´ then
Begin
qrlabel137.Caption:=´R$ 50,00´
So que compila mas não abre, onde estou errando?
Gostei + 0
24/07/2004
Ariovaldo
if Datamodule2.ADOQueryGeralCURSO.Value = ´Anual´ then
begin
Qrlabel137.Caption:=´R$ 30,00´;
End else
||
Espero ter ajudado
Gostei + 0
25/07/2004
Zottis
procedure TImprime.QuickRepBeforePrint(
Sender: TCustomQuickRep; var PrintReport: Boolean);
begin
Sender.AllDataSets.Add(Datamodule2.ADOQueryGeral);
end;
mas tente usar a 1ª opcão que te passei, para mim funciona redondinho.
ou tente no evento startpage.
procedure TQuickReport1.QuickRepStartPage(Sender: TCustomQuickRep);
begin
if Datamodule2.ADOQueryGeralCURSO.Value = ´Anual´ then
begin
Qrlabel137.Caption:=´R$ 30,00´;
End else
if Datamodule2.ADOQueryGeralCURSO.Value = ´Semestral´ then
begin
qrlabel137.Caption:=´R$ 50,00´;
End Else
if Datamodule2.ADOQueryGeralCURSO.Value = ´E.J.A´ then
Begin
qrlabel137.Caption:=´R$ 50,00´
end;
Gostei + 0
25/07/2004
Xadriano
Adriano
Gostei + 0
25/07/2004
Zottis
www.zottis.com.br estou começando e em breve será outro site mais incrementado para a programação delphi.
zottis@zottis.com.br
suporte@zottis.com.br
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)