把图片插入到EXCEL固定列中 ( 积分: 100 )

  • 主题发起人 主题发起人 sky1000
  • 开始时间 开始时间
S

sky1000

Unregistered / Unconfirmed
GUEST, unregistred user!
把图片插入到EXCEL固定列中
 
建议保存图片路径!~保存图片的话 如果多了 读取速度很慢的!~!~
 
如是數據庫中的話﹐那先讀出來并保存為臨時文件后。。。。如下﹐﹐﹐有點長
L_path:=ExtractFilePath(application.ExeName)+'~~temp.jpg';
deleteFile(L_path);
if A_hzitem.FieldByName('jpwt_photo').Value<>'' then
TBlobField(A_hzitem.FieldByName('jpwt_photo')).SaveToFile(L_path);
FWorkSheet.range['O'+intTostr(xx),'W'+intTostr(xx+3)].columns.HorizontalAlignment:=xlleft;
FWorkSheet.range['O'+intTostr(xx),'W'+intTostr(xx+3)].columns.VerticalAlignment:=xlcenter;
FWorkSheet.range['O'+intTostr(xx),'W'+intTostr(xx+3)].Merge(wraptext);
FWorkSheet.range['O'+intTostr(xx),'W'+intTostr(xx+3)].borders.linestyle:=xlContinuous;
FWorkSheet.cells.item[xx,15].select;
if FileExists(L_path) then
begin
FPicture:=FWorkSheet.Pictures.Insert(L_path);
FPicture.Height:=57;
FPicture.Width:=75.75;
end;
deleteFile(L_path);
 
后退
顶部