Tengo un procedimiento que crea labels en un reporte de QuickReport, el código es el siguiente:
Código Delphi
[-]procedure CrearQRLabel(var xLabel : TQRLabel;qrReporte : TQuickRep;sCaption : String;
iLeft,iTop,iwidth : smallint;
bPadre : TQRBand;bSize : Boolean;
iAlinear : Smallint);
begin
xLabel := TQRLabel.Create(Application);
with xLabel do
begin
Caption := sCaption;
Autosize := bSize;
Left := iLeft;
Top := iTop;
Width := iWidth;
Parent := bPadre;
ParentReport := qrReporte;
Enabled := true;
visible := true;
ParentFont := true;
Transparent := true;
Height := Parent.Height;
case iAlinear of
0 : Alignment := taLeftJustify;
1 : Alignment := taRightJustify;
2 : Alignment := taCenter;
end;
end;
end;
Parametro 1,un control de tipo QRLabel
Parametro 2 El nombre de tu reporte
Parametro 3 El valor de la propiedad Caption
Parametro 4 La posición izquierda
Parametro 5 La Posicion superior
Parametro 6 El ancho del label
Parametro 7 La banda en la que aparecera el label
Parametro 8 Si es true, el label aumentara/reducira su tamaño segun el contenido
parametro 9 A que lado se alinea el contenido: 0=Izquierda, 1= Derecha,2=Centro
Un ejemplo de como llamar a este procedimiento es el siguiente:
Código Delphi
[-]var
xLabelCta : TQRLabel;
....
CrearQRLabel(xLabelCuenta,qrCuentas,'Nombre de la cuenta',
10,0,120,qrbTitulos,false,2);
Espero que te sirva
Saludos