Trying to load a image from file returns an access violation ...
Hi All,
I currently have a report with two section subreports in a detail band. The
first subreports loads the images correctly from the file but the second
doesnt.
Here is the code being used:
if not qReportTemplate.FieldByName('FloorPlan').IsNull then
begin
strFilename_FloorPlan := SystemDM.ReadRegistry_String('Settings',
'ImagePath') + '\' + qReportTemplate.FieldValues['FloorPlan'];
ppImg_FloorPlan.Picture.Graphic.LoadFromFile(strFilename_FloorPlan);
end;
I even tried copying the image componet to the first subreport where the
images are loading correctly and still recieved the access violation.
Please Help!!!!
Trevor
I currently have a report with two section subreports in a detail band. The
first subreports loads the images correctly from the file but the second
doesnt.
Here is the code being used:
if not qReportTemplate.FieldByName('FloorPlan').IsNull then
begin
strFilename_FloorPlan := SystemDM.ReadRegistry_String('Settings',
'ImagePath') + '\' + qReportTemplate.FieldValues['FloorPlan'];
ppImg_FloorPlan.Picture.Graphic.LoadFromFile(strFilename_FloorPlan);
end;
I even tried copying the image componet to the first subreport where the
images are loading correctly and still recieved the access violation.
Please Help!!!!
Trevor
This discussion has been closed.
Comments
I believe the Graphic property is nil in this case. Try using the
TPicture.LoadFromFile routine instead.
ppImg_FloorPlan.Picture.LoadFromFile(strFilename_FloorPlan);
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com