Cita:
Empezado por heroe
Para acceder al diseño del reporte, coloca un componente frxReport1, y has doble clic en el.
Ahora para agregar variables, ve al Menu, Report, y has clic en variables.
Añade una nueva variable, has clic en OK.
Finalmente, ve a DataTree(a la derecha de la pantalla) y selecciona la pestaña variables, ahora arrastra la variable al Reporte.
Desde el código, primero debes llenar las variables y luego mostrar el reporte, por ejemplo:
Código Delphi [-]
frxReport1.Variables['Variable1'] := QuotedStr(Empresa);
frxReport.ShowReport();
Nota: Entre paréntesis va el nombre de la variable definida en el reporte. Además si vas a pasar valores tipo string usa la instrucción QuotedStr.
|
de esta forma si me esta funcoinando..
ya veo el nombre e id de la empresa
es posible pasar por variable una imagen que tengo en la base de datos
firebird 2.1 como cambpo blob. subtype binary al reporte
para mostrar la imagen o logo de la empresa (tambien quiero mostras imagenes de lo que compro, en el detalle )?
tengo esta query en delphi l aejecuto
y del resultado tomo los valores y los paso por variable al fastreport
Código Delphi
[-]
SELECT
EMPRESA.ID,
EMPRESA.TOTALVENTA, EMPRESA.RFC,
EMPRESA.NOMBRE,
EMPRESA.PAIS, EMPRESA.ESTADO,
EMPRESA.TELEFONO, EMPRESA.LOGO,
FROM
EMPRESA
WHERE
ID = 1
asi
var
EMPRESA_ID:integer
EMPRESA_TOTALVENTA :Real;
EMPRESA_RFC :String;
EMPRESA_NOMBRE:string;
EMPRESA_PAIS :string;
EMPRESA_ESTADO:String
EMPRESA_TELEFONO :String
EMPRESA_LOGO: begin
try
QryCliente.Close;
QryCliente.SQL.Clear;
QryCliente.SQL.Add(sSql ); QryCliente.Execute;
finally
end;
try
for j := 0 to QryCliente.RecordCount - 1 do
begin
empresa id := QryCliente.Fields[0].AsInteger;
EMPRESA_LOGO := QryCliente.Fields[1].AsString; end;
end;
creo que la misma query dentro de fastreport se puede usar
y asignar componente de imagen para el campo blob algo asi.
SELECT
EMPRESA.ID,
EMPRESA.TOTALVENTA, // campo numeric (14, 4) lo manejo como variable real
EMPRESA.RFC,
EMPRESA.NOMBRE,
EMPRESA.PAIS, // campo string
EMPRESA.ESTADO,
EMPRESA.TELEFONO, //campo integer
EMPRESA.LOGO, //campo blob subtype binary
FROM
EMPRESA
WHERE
ID = :Variable1
[/delphi]
eso es loq ue ahora estoy probando hacerlo funcional..
gracias
heroe