nomegrupo:= Copy(nomegrupo,1,Length(nomegrupo)-1);

Delphi

03/04/2003

Ola galera, preciso selecionar alguns itens em um registro e o meu relatório imprime akeles itens ... veja o q fiz

NOMEGRUPO:= ´´;
for i := 0 to lista.Items.Count-1 do
begin
if lista.Selected[i] then
NOMEGRUPO := NOMEGRUPO + Lista.Items.Strings[i]+´,´;
end;
NOMEGRUPO := Copy(NOMEGRUPO ,1,Length(NOMEGRUPO)-1);
IBTIPOREl.Close;
IBTIPOREl.SQL.Clear;
showmessage(NOMEGRUPO);//// fiz isso pra testar e ele ta dando valor em branco
IBTIPOREL.SQL.add(´SELECT * FROM TIPOPROD where TIPO in (+NOMEGRUPO+)´);
IBTIPOREL.Open;
Quickrep1.Preview;

alguém pode me dizer qual o problema???? Ou tem outra idéia?
falow

Favor postar o título em minúsculas
Moderador


Anonymous

Anonymous

Curtidas 0

Respostas

Adilsond

Adilsond

03/04/2003

Isto apenas irá funcionar se o que voce estiver inserindo no NOMEGRUPO for numérico.


GOSTEI 0
Anonymous

Anonymous

03/04/2003

Wiccano faça o seguinte:

NOMEGRUPO:= ´´;
for i := 0 to Lista.Items.Count-1 do begin
if Lista.Selected[i] then
NOMEGRUPO := NOMEGRUPO +´´´+Lista.Items.Strings[i]+´´´+´,´;
end;
NOMEGRUPO := Copy(NOMEGRUPO ,1,Length(NOMEGRUPO)-1);
IBTIPOREl.Close;
IBTIPOREl.SQL.Clear;
showmessage(NOMEGRUPO);//// fiz isso pra testar e ele ta dando valor em branco
IBTIPOREL.SQL.add(´SELECT * FROM TIPOPROD where TIPO in (´+NOMEGRUPO+´)´);
showmessage(IBTIPOREl.SQL.Text); /// ver o texto
IBTIPOREl.Open;
Quickrep1.Preview;


Creio que vai funcionar

Até +


GOSTEI 0
POSTAR