Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus-es / 2010-04

LazReport

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Héctor S. Ponce

Hola,

Tengo un problema con LazReport. No asigna valor a las variables.

Porcion del fuente de la clase LR_Class:
------------------------------------------------------------

(Linea 7465)

    else if AFormatStr[1] in ['D', 'T', 'd', 't'] then
    begin
      AFormat := $02040000;
      AFormatStr := Copy(AFormatStr, 2, 255);
    end
    else if AFormatStr[1] in ['B', 'b'] then
    begin
      AFormat := $04040000;
      AFormatStr := Copy(AFormatStr, 2, 255);
    end;
  end;
  CurVariable := ParName;
  CurValue := 0;
///////////////////////
  GetVariableValue(ParName, CurValue);
<<<<------------------------------------  ACA ESTA LA LLAMADA A MI
PROCEDIMIENTO
// EL NOMBRE DE LA VARIABLE DEL REPORTE EN PARNAME ES CORRECTO "LVR_CLIENTE"
//
///////////////////////
  ParValue := FormatValue(CurValue, AFormat, AFormatStr);
  {
  if TVarData(CurValue).VType=varString then
    ValStr := CopyVarString(CurValue)
  else
    ValStr := CurValue;
  ParValue := FormatValueStr(ValStr, Format, FormatStr);
  }
  {$IFDEF DebugLR}
  DebugLn('%sTfrReport.InternalOnGetValue(%s)
Value=%s',[sspc,ParName,ParValue]);
  {$ENDIF}
end;

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
//
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;
  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;

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
------------ pr�xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus-es/attachments/20100408/4d7aa38f/attachment.html>

Reply by email

Jesus Reyes
to Héctor S. Ponce

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.freepascal.org/pipermail/lazarus-es/attachments/20100410/f75d24e9/attachment.html>

Reply by email