AndGaG
15-10-2007, 18:38:44
Saludos a todos.
Mi problema es que no he podido hacer que refresque los datos un reporte de fastreport en tiempo de ejecucion. Trabajo con PostgreSQL y Delphi 7, uso los componentes Zeos para acceso a datos.
Aqui esta mi codigo
Código Delphi [-] (http://www.clubdelphi.com/foros/#)procedure TfrmReporteCatImg.FormCreate(Sender: TObject);
begin DataSetCatFotos.DataSet:= nil;
ZQCatFotos.Active:= False;
ZQCatFotos.Close;
ZQCatFotos.SQL.Clear;
ZQCatFotos.SQL.Text:= 'SELECT R.id_refa, R.no_orig, R.no_pza, R.descrip, ' +
'R.precio1, R.precio2, R.precio3, R.precio4, R.precio5, ' +
'R.observs, RG.foto, MD.nombre AS medida, MR.nombre as marca, R.costo_p, R.costo_auxiliar ' +
'FROM refacciones R INNER JOIN marcas MR ON (R.id_marca = MR.id_marca) ' +
'INNER JOIN medidas MD ON (R.id_med = MD.id_medida) ' +
'INNER JOIN refacciones_gral RG ON (R.id_refa = RG.id_refa) ' +
'ORDER BY R.id_refa';
ZQCatFotos.Open;
ZQCatFotos.Active:= True;
ZQCatFotos.Refresh;
DataSetCatFotos.DataSet:= frmReporteCatImg.ZQCatFotos;
ReporteCatFotos.Variables['nombre_reporte']:= QuotedStr('REPORTE DE PARTES AL DIA ');
//ReporteCatFotos.PrepareReport(True);
ReporteCatFotos.LoadFromFile('C:\Documents and Settings\Andres\Escritorio\Reportes FastReport\Reporte_test_imagenes(2).fr3', True);
ReporteCatFotos.PrepareReport(True);
ReporteCatFotos.ShowPreparedReport;
Close();
end;
Este codigo esta dentro del metodo Create del formulario, del cual su propiedad FormStyle es fsNormal, y el componente del reporte tiene la propiedad PreviewOptions[Modal] en True, pero todavia no he podido hacer que refresque los datos, aunque me he dado cuenta que cuando cierro el formulario desde donde tengo la instruccion Código Delphi [-] (http://www.clubdelphi.com/foros/#)Application.CreateForm(TfrmReporteCatImg, frmReporteCatImg);
para mostrar el reporte y lo abro nuevamente, puedo ver entonces los datos refrescados. Alguna sugerencia o idea de por que tengo este problema, se los agradezco de antemano.
Mi problema es que no he podido hacer que refresque los datos un reporte de fastreport en tiempo de ejecucion. Trabajo con PostgreSQL y Delphi 7, uso los componentes Zeos para acceso a datos.
Aqui esta mi codigo
Código Delphi [-] (http://www.clubdelphi.com/foros/#)procedure TfrmReporteCatImg.FormCreate(Sender: TObject);
begin DataSetCatFotos.DataSet:= nil;
ZQCatFotos.Active:= False;
ZQCatFotos.Close;
ZQCatFotos.SQL.Clear;
ZQCatFotos.SQL.Text:= 'SELECT R.id_refa, R.no_orig, R.no_pza, R.descrip, ' +
'R.precio1, R.precio2, R.precio3, R.precio4, R.precio5, ' +
'R.observs, RG.foto, MD.nombre AS medida, MR.nombre as marca, R.costo_p, R.costo_auxiliar ' +
'FROM refacciones R INNER JOIN marcas MR ON (R.id_marca = MR.id_marca) ' +
'INNER JOIN medidas MD ON (R.id_med = MD.id_medida) ' +
'INNER JOIN refacciones_gral RG ON (R.id_refa = RG.id_refa) ' +
'ORDER BY R.id_refa';
ZQCatFotos.Open;
ZQCatFotos.Active:= True;
ZQCatFotos.Refresh;
DataSetCatFotos.DataSet:= frmReporteCatImg.ZQCatFotos;
ReporteCatFotos.Variables['nombre_reporte']:= QuotedStr('REPORTE DE PARTES AL DIA ');
//ReporteCatFotos.PrepareReport(True);
ReporteCatFotos.LoadFromFile('C:\Documents and Settings\Andres\Escritorio\Reportes FastReport\Reporte_test_imagenes(2).fr3', True);
ReporteCatFotos.PrepareReport(True);
ReporteCatFotos.ShowPreparedReport;
Close();
end;
Este codigo esta dentro del metodo Create del formulario, del cual su propiedad FormStyle es fsNormal, y el componente del reporte tiene la propiedad PreviewOptions[Modal] en True, pero todavia no he podido hacer que refresque los datos, aunque me he dado cuenta que cuando cierro el formulario desde donde tengo la instruccion Código Delphi [-] (http://www.clubdelphi.com/foros/#)Application.CreateForm(TfrmReporteCatImg, frmReporteCatImg);
para mostrar el reporte y lo abro nuevamente, puedo ver entonces los datos refrescados. Alguna sugerencia o idea de por que tengo este problema, se los agradezco de antemano.