GRACIAS POR RESPONDER !!!
Date: Sat, 10 Apr 2010 00:09:52 -0700 (PDT)
Show quoted text 26 lines
From: Jesus Reyes <jesusrmx en yahoo.com.mx>
Subject: Re: [Lazarus-es] LazReport
To: Spanish version of Lazarus List
<lazarus-es en lists.lazarus.freepascal.org>
Message-ID: <888312.64841.qm en web53201.mail.re2.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
Saludos H�ctor Ponce,
--- El jue 8-abr-10, H�ctor S. Ponce <hectorsponce en gmail.com> escribi�:
// EL NOMBRE DE LA VARIABLE DEL REPORTE EN PARNAME ES CORRECTO
"LVR_CLIENTE"N�tese como el nombre de la variable esta en may�sculas
LVR_CLIENTE y no LRV_CLIENTE
//Fuente de mi procedimiento
-----------------------------------------
procedure Tfacturador.frReport1GetValue(ParName: String; var ParValue:
Variant);
//
// ACA EL CONTENIDO DE LA VARIABLE PARNAME ES
'VR_CLIE#0#0#.........................................'
// POR LO QUE NUNCA OBTIENE EL VALOR DADO QUE NO RESULTA VERDADERA NUNGUNA
IGUALDAD
Creo que este valor lo sacaste del depurador, ya sea fuera de lazarus o dentro de lazarus, lo que pasa es que posiblemente no este obteniendo el valor correcto de un variante.
EL PROBLEMA NO SE REFIERE AL VALOR DEL VARIANT SINO AL DE LA VARIABLE ParName AL QUE LE TRUNCA LA PRIMERA LETRA DEL CONTENIDO Y LA LLENA DE BASURA.
Show quoted text 15 lines
Pero eso es un detalle del depurador gdb y su soporte de freepascal.
//
begin
//
frReport1.Values.FindVariable('LRV_CLIENTE').Field:=QuotedStr('LRV_CLIENTE');
if UpperCase(ParName)=' LRV_EMPRESA' then
ParValue:=trim(DataModule1.GetKey('EMPRESA'));
if ParName=' lrv_cliente' then ParValue:=cliente;
Y aqu� es donde aparentemente esta el problema, estas comparando una cadena
que supuestamente es LRV_CLIENTE (o LRV_CLIENTE, hay que verificar tambien
esto) en may�sculas con una lrv_cliente en min�sculas. Es mejor: if
CompareText(ParName,'lrv_cliente')=0 o sin necesidad de conversi�n de tipo,
usar el mismo tipo tanto en el reporte como en el c�digo.
ACA TAMBIEN ESTA EL AGREGADO DE QUE EN UN PROYECTO NUEVO CON SOLO UN BUTTON Y UN FRREPORT FUNCIONA BIEN... DEBE TENER ALGO EL FORM DEL PROYECTO MIO Y NO SE QUE ES
------------ pr�xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus-es/attachments/20100410/6e8adc7a/attachment.html>
