Forum > LazReport

Run time loading Picture in MasterData when record changes


Lazarus beta (Ubuntu 11.04)
FPC: 2.4.0
SVN Revision: 22277

I am using MySQL 5.1 in Lazarus Linux version. In LazReport I need to print a MySQL field which is a jpg. I am also using Zeos components.  Since you cannot display a MySQL picture in the DBImage, I am forced to load the stream into a TImage and save the picture to a temporary file. Now I can load the picture into the Picture1.Graphic. The problem is that when I place the Picture1 object into the MasterData band, I need to load the picture when the frDataSet.OnNext is triggered. So far I cannot get the Picture1 to load from the saved file. I have no problem in loading the TPicture using TfrPictureView(frReport1.FindObject('Picture1')).Picture.LoadFromFile(FPath+FileName); if the TPicture does not change in the report.

Any suggestions on how to load the TPicture in LazReport when it is in the MasterData band when the next record is read? I appreciate your help.

 :D I found the solution:

procedure TForm1.frReport1EnterRect(Memo: TStringList;  View: TfrView);
  if View.Name = 'Picture1' then


[0] Message Index

Go to full version