ajuda com função no delphi
Boa tarde
tenho uma unit funções e entre varias funções tenho essa
declaração da função
function chama_QrRelatorio(var FormQR: TFrmQrRelatorio; XML_CCE, XML_NFE: WideString) : Boolean;
corpo da função
function chama_QrRelatorio(var FormQR: TFrmQrRelatorio; XML_CCE, XML_NFE: WideString) : Boolean;
var data, hora : String;
XMLItem : WideString;
tagini, tagfim : string;
begin
try
FormQR := TFrmQrRelatorio.Create(nil);
//Atribuição dos Campos
FormQR.QRLbDataHora.Caption := FormatDateTime('dd/mm/yyyy hh:mm', now());
FormQR.QRLbChave.Caption := GetValorTag('chNFe', XML_CCE);
FormQR.CJVQRBarCode.Texto := GetValorTag('chNFe',XML_CCE);
// 2012-07-24T17:55:20-03:00
data := copy(GetValorTag('dhRegEvento',XML_CCE), 1, 10);
data := copy(data,9,2)+'/'+copy(data,6,2)+'/'+copy(data,1,4);
hora := copy(GetValorTag('dhRegEvento',XML_CCE), 12, 8);
FormQR.QRLbProtocolo.Caption := GetValorTag('nProt',XML_CCE)+ ' ' + data + ' ' + Hora;
FormQR.QRLbCNPJEmit.Caption := FormatMaskText('99.999.999/9999-99;0;', GetValorTag('CNPJ',XML_CCE));
FormQR.QRTxtCorrecao.Lines.Clear;
FormQR.QRTxtCorrecao.Lines.Add( GetValorTag('xCorrecao',XML_CCE) );
FormQR.QRLbNFe.Caption := copy(GetValorTag('chNFe',XML_CCE), 26, 9);
FormQR.QRLbSerie.Caption := copy(GetValorTag('chNFe',XML_CCE), 23, 3);
FormQR.QRLbOrgao.Caption := GetValorTag('cOrgao',XML_CCE);
FormQR.QRLbTipoEvento.Caption := GetValorTag('tpEvento',XML_CCE);
FormQR.QRLbSeqEvento.Caption := GetValorTag('nSeqEvento',XML_CCE);
FormQR.QRLbVersao.Caption := GetValorTag('verEvento',XML_CCE);
if SearchValorTag('CPFDest', XML_CCE) then
FormQR.QRLbCNPJDest.Caption := FormatMaskText('999.999.999-99;0;', GetValorTag('CPFDest',XML_CCE))
else
FormQR.QRLbCNPJDest.Caption := FormatMaskText('99.999.999/9999-99;0;', GetValorTag('CNPJDest',XML_CCE));
FrmQrRelatorio.QRLbEmailDest.Caption := GetValorTag('emailDest', XML_CCE);
if GetValorTag('tpAmb',XML_CCE) = '1' then
FormQR.QRLbAmbiente.Caption := 'PRODUÇÃO'
else
FormQR.QRLbAmbiente.Caption := 'HOMOLOGAÇÃO';
// Ler XML da Nota para pegar os nomes do destinatario e emitentente
tagini := '<emit>';
tagfim := '</emit>';
XMLItem := GetValorTagSection(tagini, tagfim, XML_NFE);
if Length(trim(GetValorTag( 'xNome', XMLItem ))) > 0 then
begin
FormQR.QRLbNomeEmit.Caption := GetValorTag( 'xNome', XMLItem );
FormQR.QRLbNomeEmit.Caption := stringreplace ( FormQR.QRLbNomeEmit.Caption, '&', '&', []);
end
else
FormQR.QRLbNomeEmit.Caption := '';
tagini := '<dest>';
tagfim := '</dest>';
XMLItem := GetValorTagSection(tagini, tagfim, XML_NFE);
if Length(trim(GetValorTag( 'xNome', XMLItem ))) > 0 then
FormQR.QRLbNomeDest.Caption := GetValorTag( 'xNome', XMLItem )
else
FormQR.QRLbNomeDest.Caption := '';
Result := True;
except
Result := False;
Exit;
end;
end;
o erro é esse [dcc32 Error] Untfuncoes.pas(116): E2003 Undeclared identifier: 'TFrmQrRelatorio'
tenho uma unit funções e entre varias funções tenho essa
declaração da função
function chama_QrRelatorio(var FormQR: TFrmQrRelatorio; XML_CCE, XML_NFE: WideString) : Boolean;
corpo da função
function chama_QrRelatorio(var FormQR: TFrmQrRelatorio; XML_CCE, XML_NFE: WideString) : Boolean;
var data, hora : String;
XMLItem : WideString;
tagini, tagfim : string;
begin
try
FormQR := TFrmQrRelatorio.Create(nil);
//Atribuição dos Campos
FormQR.QRLbDataHora.Caption := FormatDateTime('dd/mm/yyyy hh:mm', now());
FormQR.QRLbChave.Caption := GetValorTag('chNFe', XML_CCE);
FormQR.CJVQRBarCode.Texto := GetValorTag('chNFe',XML_CCE);
// 2012-07-24T17:55:20-03:00
data := copy(GetValorTag('dhRegEvento',XML_CCE), 1, 10);
data := copy(data,9,2)+'/'+copy(data,6,2)+'/'+copy(data,1,4);
hora := copy(GetValorTag('dhRegEvento',XML_CCE), 12, 8);
FormQR.QRLbProtocolo.Caption := GetValorTag('nProt',XML_CCE)+ ' ' + data + ' ' + Hora;
FormQR.QRLbCNPJEmit.Caption := FormatMaskText('99.999.999/9999-99;0;', GetValorTag('CNPJ',XML_CCE));
FormQR.QRTxtCorrecao.Lines.Clear;
FormQR.QRTxtCorrecao.Lines.Add( GetValorTag('xCorrecao',XML_CCE) );
FormQR.QRLbNFe.Caption := copy(GetValorTag('chNFe',XML_CCE), 26, 9);
FormQR.QRLbSerie.Caption := copy(GetValorTag('chNFe',XML_CCE), 23, 3);
FormQR.QRLbOrgao.Caption := GetValorTag('cOrgao',XML_CCE);
FormQR.QRLbTipoEvento.Caption := GetValorTag('tpEvento',XML_CCE);
FormQR.QRLbSeqEvento.Caption := GetValorTag('nSeqEvento',XML_CCE);
FormQR.QRLbVersao.Caption := GetValorTag('verEvento',XML_CCE);
if SearchValorTag('CPFDest', XML_CCE) then
FormQR.QRLbCNPJDest.Caption := FormatMaskText('999.999.999-99;0;', GetValorTag('CPFDest',XML_CCE))
else
FormQR.QRLbCNPJDest.Caption := FormatMaskText('99.999.999/9999-99;0;', GetValorTag('CNPJDest',XML_CCE));
FrmQrRelatorio.QRLbEmailDest.Caption := GetValorTag('emailDest', XML_CCE);
if GetValorTag('tpAmb',XML_CCE) = '1' then
FormQR.QRLbAmbiente.Caption := 'PRODUÇÃO'
else
FormQR.QRLbAmbiente.Caption := 'HOMOLOGAÇÃO';
// Ler XML da Nota para pegar os nomes do destinatario e emitentente
tagini := '<emit>';
tagfim := '</emit>';
XMLItem := GetValorTagSection(tagini, tagfim, XML_NFE);
if Length(trim(GetValorTag( 'xNome', XMLItem ))) > 0 then
begin
FormQR.QRLbNomeEmit.Caption := GetValorTag( 'xNome', XMLItem );
FormQR.QRLbNomeEmit.Caption := stringreplace ( FormQR.QRLbNomeEmit.Caption, '&', '&', []);
end
else
FormQR.QRLbNomeEmit.Caption := '';
tagini := '<dest>';
tagfim := '</dest>';
XMLItem := GetValorTagSection(tagini, tagfim, XML_NFE);
if Length(trim(GetValorTag( 'xNome', XMLItem ))) > 0 then
FormQR.QRLbNomeDest.Caption := GetValorTag( 'xNome', XMLItem )
else
FormQR.QRLbNomeDest.Caption := '';
Result := True;
except
Result := False;
Exit;
end;
end;
o erro é esse [dcc32 Error] Untfuncoes.pas(116): E2003 Undeclared identifier: 'TFrmQrRelatorio'
Emanuel Gonçalves
Curtidas 0
Respostas
Raylan Zibel
25/04/2016
Deve estar faltando o Uses da unit referente ao formulario tipo "TFrmQrRelatorio". Se vai usar um tipo, precisa informar onde ele está declarado.
GOSTEI 0
Emanuel Gonçalves
25/04/2016
ok, vlw.
GOSTEI 0