Multiple records on each row
Hi,
I need to print a report with ID pictures and corresponding names for each student in the classes at a school.
There should be 4 pictures on each row and eight rows on each page.
Each record's JPG image is stored in BLOB fields. I use the code below to display it in a TImage on ordinary forms in my application.
Can I use the same code here, or how do I get the images on my report?
Thanks for comments on this.
regards Tor
procedure ShowJPG(FieldImg: TBlobField; Picture: TPicture);
var
Stream: TMemoryStream;
Jpg: TJpegImage;
begin
if FieldImg.IsNull then
begin
Picture.Assign(nil);
exit;
end;
try
Stream:=TMemoryStream.Create;
Jpg:=TJpegImage.Create;
try
FieldImg.SaveToStream(Stream);
if (Stream.Size>0) then
begin
Stream.Position:=0;
Jpg.LoadFromStream(Stream);
Picture.Assign(Jpg);
end
else Picture.Assign(nil);
finally
jpg.Free;
Stream.Free;
end;
except
Picture.Assign(nil);
end;
end; {ShowJPG}
I need to print a report with ID pictures and corresponding names for each student in the classes at a school.
There should be 4 pictures on each row and eight rows on each page.
Each record's JPG image is stored in BLOB fields. I use the code below to display it in a TImage on ordinary forms in my application.
Can I use the same code here, or how do I get the images on my report?
Thanks for comments on this.
regards Tor
procedure ShowJPG(FieldImg: TBlobField; Picture: TPicture);
var
Stream: TMemoryStream;
Jpg: TJpegImage;
begin
if FieldImg.IsNull then
begin
Picture.Assign(nil);
exit;
end;
try
Stream:=TMemoryStream.Create;
Jpg:=TJpegImage.Create;
try
FieldImg.SaveToStream(Stream);
if (Stream.Size>0) then
begin
Stream.Position:=0;
Jpg.LoadFromStream(Stream);
Picture.Assign(Jpg);
end
else Picture.Assign(nil);
finally
jpg.Free;
Stream.Free;
end;
except
Picture.Assign(nil);
end;
end; {ShowJPG}
Comments
for multiple images across divide either the band or the page into columns.
Thanks, for the help. I finally found out of it :-)