gedmilson Membro Junior

Registrado: Sexta-Feira, 22 de Julho de 2005 Mensagens: 305
|
Enviada: Sáb Nov 06, 2010 5:21 pm Assunto: Relatorio clik roport (RESOUVIDO) |
|
|
Estou com o filtro feito do seguinte modo
procedure Tfrmencaminhar.Button1Click(Sender: TObject);
begin
with DM.ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add(' SELECT m.nome, m.bairro, m.Situaçao, m.telefone, c.curso FROM candidato m inner join CURSOS c on m.nome = c.nome ');
SQL.Add(' WHERE 1=1 ');
if (DBLookupComboBox1.Text <> '') then
begin
SQL.Add(' AND c.curso like :c.curso ');
Parameters.ParamByName('c.curso').Value := '%'+DBLookupComboBox1.Text+'%';
end;
if (DBComboBox1.Text <> '') then
begin
SQL.Add(' AND m.sexo like :m.sexo ');
Parameters.ParamByName('m.sexo').Value := '%'+DBComboBox1.Text+'%';
end;
if (DBComboBox2.Text <> '') then
begin
SQL.Add(' AND m.bairro like :m.bairro ');
Parameters.ParamByName('m.bairro').Value := '%'+DBComboBox2.Text+'%';
end;
if (DBComboBox3.Text <> '') then
begin
SQL.Add(' AND m.escolaridade like :m.escolaridade ');
Parameters.ParamByName('m.escolaridade').Value := '%'+DBComboBox3.Text+'%';
end;
if (DBComboBox4.Text <> '') then
begin
SQL.Add(' AND m.qual like :m.qual ');
Parameters.ParamByName('m.qual').Value := '%'+DBComboBox4.Text+'%';
end;
if (DBComboBox5.Text <> '') then
begin
SQL.Add(' AND m.estudante like :m.estudante ');
Parameters.ParamByName('m.estudante').Value := '%'+DBComboBox5.Text+'%';
end;
if (DBComboBox6.Text <> '') then
BEGIN
SQL.Add(' AND m.CATEGORIA like :m.CATEGORIA ');
Parameters.ParamByName('m.CATEGORIA').Value := '%'+DBComboBox6.Text+'%';
end;
//if (DBEdit8.Text = 'L') then
//BEGIN
//SQL.Add(' AND m.Situaçao like :m.Situaçao ');
// Parameters.ParamByName('m.Situaçao').Value := '%'+DBEdit8.Text+'%';
//end;
open;
end;
agora estou precisando passar o resultado dessa pesquisa para o ClickRoport alguém sabe como isso pode ser feito? |
|