[Lazarus-es] LazReport

Jesus Reyes jesusrmx en yahoo.com.mx
Sab Abr 10 09:09:52 CEST 2010


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 IGUALDADCreo 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. 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.
  if ParName='lrv_direccion' then ParValue:=cliente_domicilio;
  if ParName='lrv_cuit' then ParValue:=cliente_documento;
  if ParName='lrv_comprobante' then

  ParValue:=comprobante;

  if ParName='lrv_st' then ParValue:=monto_subtotal;
  if ParName='lrv_dto' then ParValue:=descuento;
  if ParName='lrv_dtomon' then ParValue:=monto_descuento;

  if ParName='lrv_tot' then ParValue:=monto_total;
  if ParName='lrv_fp1' then ParValue:=pago_medio[1];
  if ParName='lrv_ref1' then ParValue:=pago_ref[1];
  if ParName='lrv_imp1' then ParValue:=pago_importe[1];

  if ParName='lrv_fp2' then ParValue:=pago_medio[2];
  if ParName='lrv_ref2' then ParValue:=pago_ref[2];
  if ParName='lrv_imp2' then ParValue:=pago_importe[2];
  if ParName='lrv_fp3' then ParValue:=pago_medio[3];

  if ParName='lrv_ref3' then ParValue:=pago_ref[3];
  if ParName='lrv_imp3' then ParValue:=pago_importe[3];
  if ParName='lrv_pagado' then ParValue:=pagado;
end;                                  


seguramente tendran el mismo problema.

QUIERO SABER SI ALGUIEN LE HA PASADO LO MISMO Y COMO LO HA SOLUCIONADO.

ESTOY COMPILANDO EN WIN 7, LAZARUS 0.9.29, FPC: 2.5.1

MUCHAS GRACIAS



HECTOR PONCE


Jesus Reyes A.



      Encuentra las mejores recetas en Yahoo! Cocina.                       
http://mx.mujer.yahoo.com/cocina/
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus-es/attachments/20100410/f75d24e9/attachment-0002.html>


More information about the Lazarus-es mailing list