Quick reporter com datas
Como é que eu faço para para selecionar datas para serem impressas ?
Ex: Quero imprimir meu movimeno do dias 01/06/03 até 15/06/03 .
Coloquei dois maskedits um pra receber a data inicial e um pra receber a data final . também sei que usarei o Between para pegar a data do Maskedit1 até o Maskedit 2 .
Porem nao sei onde digitarei o codigo nem como será o codigo para jogar esses dados nomeu quickreporter1 .
Se alguem puder me ajudar .
Ex: Quero imprimir meu movimeno do dias 01/06/03 até 15/06/03 .
Coloquei dois maskedits um pra receber a data inicial e um pra receber a data final . também sei que usarei o Between para pegar a data do Maskedit1 até o Maskedit 2 .
Porem nao sei onde digitarei o codigo nem como será o codigo para jogar esses dados nomeu quickreporter1 .
Se alguem puder me ajudar .
Dimasarantes
Curtidas 0
Respostas
Yanomami
26/06/2003
procedure TfrmRelOrEntrega.BitBtn1Click(Sender: TObject);
var
a, b, c: string;
begin
if rbCliente.Checked = true then
begin
a:=´SELECT USUARIOS.NOME, USUARIOS.CODIGO,[Ordem Producao].OP_Solicitacao, [Ordem Producao OD].OD_numero,[Ordem Producao OD].OD_DataExp, [Ordem Producao OD].OD_Aprovada, [Ordem Producao OD].OD_ValorItem ´;
b:=´FROM ([Ordem Producao OD] INNER JOIN [Ordem Producao] ON [Ordem Producao OD].OP_numero = [Ordem Producao].OP_numero) INNER JOIN USUARIOS ON [Ordem Producao].CODIGO = USUARIOS.CODIGO ´;
c:=´where [Ordem Producao OD].OD_DataExp between :Ini and :Fim and USUARIOS.CODIGO =:codigo order by [Ordem Producao OD].OD_numero´;
relOrdEntrega.qryOrEntrega.sql.clear;
relOrdEntrega.qryOrEntrega.SQL.Add(a+b+c);
relOrdEntrega.qryOrEntrega.ParamByName(´codigo´).AsString := dataModule1.tbClientesCODIGO.Value;
relOrdEntrega.qryOrEntrega.ParamByName(´Ini´).AsDateTime := trunc(dpDataInicial.date);
relOrdEntrega.qryOrEntrega.ParamByName(´Fim´).AsDateTime := trunc(dpDataFinal.date);
relOrdEntrega.qryOrEntrega.open;
//relOrdEntrega.qrTipo.caption := ´Em aberto´;
//relOrdEntrega.qrIni.Caption := DateToStr(dpDataInicial.date);
//relOrdEntrega.qrFim.Caption := DateToStr(dpDataFinal.date);
relOrdEntrega.QuickRep1.Preview;
end;
var
a, b, c: string;
begin
if rbCliente.Checked = true then
begin
a:=´SELECT USUARIOS.NOME, USUARIOS.CODIGO,[Ordem Producao].OP_Solicitacao, [Ordem Producao OD].OD_numero,[Ordem Producao OD].OD_DataExp, [Ordem Producao OD].OD_Aprovada, [Ordem Producao OD].OD_ValorItem ´;
b:=´FROM ([Ordem Producao OD] INNER JOIN [Ordem Producao] ON [Ordem Producao OD].OP_numero = [Ordem Producao].OP_numero) INNER JOIN USUARIOS ON [Ordem Producao].CODIGO = USUARIOS.CODIGO ´;
c:=´where [Ordem Producao OD].OD_DataExp between :Ini and :Fim and USUARIOS.CODIGO =:codigo order by [Ordem Producao OD].OD_numero´;
relOrdEntrega.qryOrEntrega.sql.clear;
relOrdEntrega.qryOrEntrega.SQL.Add(a+b+c);
relOrdEntrega.qryOrEntrega.ParamByName(´codigo´).AsString := dataModule1.tbClientesCODIGO.Value;
relOrdEntrega.qryOrEntrega.ParamByName(´Ini´).AsDateTime := trunc(dpDataInicial.date);
relOrdEntrega.qryOrEntrega.ParamByName(´Fim´).AsDateTime := trunc(dpDataFinal.date);
relOrdEntrega.qryOrEntrega.open;
//relOrdEntrega.qrTipo.caption := ´Em aberto´;
//relOrdEntrega.qrIni.Caption := DateToStr(dpDataInicial.date);
//relOrdEntrega.qrFim.Caption := DateToStr(dpDataFinal.date);
relOrdEntrega.QuickRep1.Preview;
end;
GOSTEI 0
Yanomami
26/06/2003
Esqueci de complementar, neste exemplo eu tenho um form com 2 datatimepicker, e uma query no qreport....
espero que ajude, se quiser este exemplo completo mande um mail edson_gouveia@bol.com.br
[]´s
espero que ajude, se quiser este exemplo completo mande um mail edson_gouveia@bol.com.br
[]´s
GOSTEI 0
Japa
26/06/2003
Aproveitando oq vc´s estao falando eu queria perguntar oq é QUICKREPORT tem varios topicos falando sobre isso e ainda nawn sei oq é :( :(
GOSTEI 0