[Lazarus] patch for lazreport (TfrPictureView.getBlob)

FreeMan freeman35 at delphiturkiye.com
Sun Nov 30 13:38:48 CET 2014


Why need this modify?
  I have over then 1000 rows table, but I have just 3 glyph. not 
checkbox, but can think same. Integer values  can 1-2-3. but user can 
will see graphic. for showing in lazreport, Have to add TBlobField and 
have to add glyph to all rows each time, This mean loose time and loose 
memory.
My patch check "DBImageRead" event is assigned,  if DBImageRead is 
assigned then Blob controls are starting. So, If some used this event 
and after apply this patch, no need change them codes.
I actived, TfrPictureView has no need blob field defined, can define any 
field of dataset in report, in design.

procedure TForm1.TfrReport1DBImageRead(Sender: TObject; S: TStream; var 
GraphExt: string);
begin
   Tmem_Stream.Clear;
   Tmem_Stream.Position := 0;
   GraphExt := 'bmp';
   Tmem_Stream.LoadFromFile('test.bmp');// or what ever code
{or Dataset is work synchronize so I can use dataset's any field
if myQuery.FieldByName('Test_Int').asInteger=1 then 
Tmem_Stream.LoadFromFile('test1.bmp');// etc
}
   S.CopyFrom(Tmem_Stream, Tmem_Stream.Size);
   S.Position := 0;// Have to. 'cos getblob not set
end;

I wish add to parameter TfrTField in DBImageRead event, but, when apply 
patch, have to change code, so I didn't add.
maybe lazreport's chief can add new notify event


-------------- next part --------------
A non-text attachment was scrubbed...
Name: lr_class_TfrPictureView_getBlob.diff
Type: text/x-patch
Size: 1674 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141130/f0b87997/attachment-0002.bin>


More information about the Lazarus mailing list