Hola
Lepe, gracias por responder.
De lo que se trata es de que QReport actúe en base a unas condiones externas (en mi caso las unidades de medida).
Encontré una mínima información en Google (dos enlaces), y una consulta de
jmselesan en éste foro
http://www.clubdelphi.com/foros/show...ight=functions
En teoría, según pone en
http://www.quickreport.co.uk/QuickReportFAQ.doc, en la pregunta
I have some variables defined in the report's functions property and I can't initialize them in the report's BeforePrint event., tengo que hacer lo siguiente:
1º - Crearme la variable en tiempo de diseño, por ejemplo una denominada "test"
2º - Modificarla por código, tal que así:
Código Delphi
[-]
procedure TReportForm1.CrearVariableInteger( sNombre:string; iValor:integer );
var
aQREvElement: TQREvElement;
begin
with QuickRep1.Functions do
begin
aQREvElement := GetConstant(sNombre);
if (aQREvElement <> nil) and (aQREvElement.Value(nil).Kind = resInt) then
begin
SetIntegerConstant(aQREvElement, iValor);
end;
end;
end;
function TReportForm1.LeerVariableInteger( sNombre:string ):integer;
var
aQREvElement: TQREvElement;
begin
with QuickRep1.Functions do
aQREvElement := GetConstant(sNombre);
Result := aQREvElement.Value(nil).intResult;
end;
y llamar a las funciones tal que así:
Código Delphi
[-]
var
miIntPrueba : ineteger;
begin
...
CrearVariableInteger( 'INTPRUEBA', 300 );
...
...
miIntPrueba := LeerVariableInteger( 'INTPRUEBA' );
QRLabel_PRUEBA.Caption := FormatFloat( '##0', miIntPrueba );
...
end;
Bueno, pues esto "casca" y dá un error de excepción, al hacer un seguimiento "paso a paso" la creación de la variable devuelve
nil
¿ideas?
Salvica