summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extras/contributed/report_tool/demo/u_demo.pas2
-rw-r--r--extras/contributed/report_tool/reportengine/u_report.pas57
2 files changed, 53 insertions, 6 deletions
diff --git a/extras/contributed/report_tool/demo/u_demo.pas b/extras/contributed/report_tool/demo/u_demo.pas
index 377e92cd..612e8dec 100644
--- a/extras/contributed/report_tool/demo/u_demo.pas
+++ b/extras/contributed/report_tool/demo/u_demo.pas
@@ -1536,7 +1536,7 @@ with FReport do
ImagePage(30,40,'poppy.jpg',ColDefaut,3);
ImagePage(40,70,'poppy.jpg',ColDefaut,2);
ImagePage(50,130,'poppy.jpg');
- ImagePage(0,20,'radiobuttons.bmp',Col3);
+ ImagePage(0,20,'sys.radiobuttons',Col3);
Page;
ImagePage(0,0,'poppy-nb.jpg',Col2);
ImagePage(20,100,'poppy.jpg',ColDefaut,2);
diff --git a/extras/contributed/report_tool/reportengine/u_report.pas b/extras/contributed/report_tool/reportengine/u_report.pas
index 9405ea99..ce16a378 100644
--- a/extras/contributed/report_tool/reportengine/u_report.pas
+++ b/extras/contributed/report_tool/reportengine/u_report.pas
@@ -2947,12 +2947,28 @@ then
if (Copy(ImgFileName,Succ(Pos('.',ImgFileName)),3)= 'jpg') or (Copy(ImgFileName,Succ(Pos('.',ImgFileName)),4)= 'jpeg')
then
Image:= LoadImage_JPG(ImgFileName,Scale);
- RefImage:= Images.Add(Image);
+ RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName);
+ Images.Add(Image);
end;
PaintImage(Horiz,Verti,ColNum,RefImage,zHeader);
end
else
- ShowMessage('Image '+ImgFileName+' is missing');
+ if fpgImages.GetImage(ImgFileName)<> nil
+ then
+ begin
+ RefImage:= ImageNames.IndexOf(IntToStr(Scale)+ImgFileName);
+ if RefImage= -1
+ then
+ begin
+ Image:= fpgImages.GetImage(ImgFileName);
+ Scale:= 1;
+ RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName);
+ Images.Add(Image);
+ end;
+ PaintImage(Horiz,Verti,ColNum,RefImage,zPage);
+ end
+ else
+ ShowMessage('Image '+ImgFileName+' is missing');
end;
procedure T_Report.ImagePage(Horiz,Verti: Single; ImgFileName: string; ColNum,Scale: Integer);
@@ -2984,7 +3000,22 @@ then
PaintImage(Horiz,Verti,ColNum,RefImage,zPage);
end
else
- ShowMessage('Image '+ImgFileName+' is missing');
+ if fpgImages.GetImage(ImgFileName)<> nil
+ then
+ begin
+ RefImage:= ImageNames.IndexOf(IntToStr(Scale)+ImgFileName);
+ if RefImage= -1
+ then
+ begin
+ Image:= fpgImages.GetImage(ImgFileName);
+ Scale:= 1;
+ RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName);
+ Images.Add(Image);
+ end;
+ PaintImage(Horiz,Verti,ColNum,RefImage,zPage);
+ end
+ else
+ ShowMessage('Image '+ImgFileName+' is missing');
end;
procedure T_Report.ImageFooter(Horiz,Verti: Single; ImgFileName: string; ColNum,Scale: Integer);
@@ -3010,12 +3041,28 @@ then
if (Copy(ImgFileName,Succ(Pos('.',ImgFileName)),3)= 'jpg') or (Copy(ImgFileName,Succ(Pos('.',ImgFileName)),4)= 'jpeg')
then
Image:= LoadImage_JPG(ImgFileName,Scale);
- RefImage:= Images.Add(Image);
+ RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName);
+ Images.Add(Image);
end;
PaintImage(Horiz,Verti,ColNum,RefImage,zFooter);
end
else
- ShowMessage('Image '+ImgFileName+' is missing');
+ if fpgImages.GetImage(ImgFileName)<> nil
+ then
+ begin
+ RefImage:= ImageNames.IndexOf(IntToStr(Scale)+ImgFileName);
+ if RefImage= -1
+ then
+ begin
+ Image:= fpgImages.GetImage(ImgFileName);
+ Scale:= 1;
+ RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName);
+ Images.Add(Image);
+ end;
+ PaintImage(Horiz,Verti,ColNum,RefImage,zPage);
+ end
+ else
+ ShowMessage('Image '+ImgFileName+' is missing');
end;
end.