{"id":982,"date":"2019-01-18T21:13:00","date_gmt":"2019-01-18T13:13:00","guid":{"rendered":"http:\/\/www.tairongkj.com\/?p=982"},"modified":"2019-01-18T21:15:18","modified_gmt":"2019-01-18T13:15:18","slug":"%e8%b6%85%e5%a3%b0%e6%89%93%e5%8d%b0","status":"publish","type":"post","link":"https:\/\/www.tairongkj.com\/?p=982","title":{"rendered":"\u8d85\u58f0\u6253\u5370"},"content":{"rendered":"<pre data-lang=\"pascal\"><code>procedure Trepform.frxptBeforePrint(Sender: TfrxReportComponent);\nvar filepath: string;\n  \n  rptformats: string;\n \n \n  chname, fname: string;\n  docharset, dofontchange: Boolean;\n  charsetindex, I: Integer;\n  picconter: Integer;\nbegin\n  ExportFileName := DateTimeToStr(dm.Mqry.fieldbyname('baogaoriqi').AsDateTime) + dm.mqryname.AsString;\n  picconter := 0; {\u9ed8\u8ba4\u7684\u6253\u5370\u56fe\u7247\u4e3a0}\n \n \n\/\/   sHostpitalLogo,\n\/\/   sHostpitalName,\n if frxpt.FindObject('caInfo') &lt;&gt; nil then\n    (frxpt.FindObject('caInfo') as TfrxMemoView).Memo.Text := s_CaInfo;\n  if frxpt.FindObject('hostname') &lt;&gt; nil then\n    (frxpt.FindObject('hostname') as TfrxMemoView).Memo.Text := sHostpitalName;\n   if frxpt.FindObject('hostname1') &lt;&gt; nil then\n    (frxpt.FindObject('hostname1') as TfrxMemoView).Memo.Text := sHostpitalName;\n  if frxpt.FindObject('logo') &lt;&gt; nil then\n  begin\n    if FileExists(sHostpitalLogo) then\n      (frxpt.FindObject('logo') as TfrxPictureView).Picture.LoadFromFile(sHostpitalLogo);\n  end;\n   if frxpt.FindObject('logo1') &lt;&gt; nil then\n  begin\n    if FileExists(sHostpitalLogo) then\n      (frxpt.FindObject('logo1') as TfrxPictureView).Picture.LoadFromFile(sHostpitalLogo);\n  end;\n  if ((frxpt.FindObject('reportTitle') as TfrxMemoView) &lt;&gt; nil) then\n    (frxpt.FindObject('reportTitle') as TfrxMemoView).Text := mainunit.P_reportTitle;\n      {\u8fd9\u4e24\u884c\u7684\u51b3\u5b9a\u8d85\u58f0\u6240\u89c1\u548c\u8d85\u58f0\u63d0\u793a\u662f\u5426\u652f\u6301\u591a\u884c\u663e\u793a}\n \n \n  chname := mySysParms.getElementTextAttribute('\/config\/Print', 'charset', 'font_DEFAULT_CHARSET');\n  fname :=  mySysParms.getElementTextAttribute('\/config\/Print', 'font_fontname', '\u5b8b\u4f53');\n  dofontchange :=mySysParms.getElementBooleanAttribute('\/config\/Print','font_fontChange',True);\n  docharset:= mySysParms.getElementBooleanAttribute('\/config\/Print','font_used', True);\n \n  IdentToCharset(chname, charsetindex);\n  for i := 0 to frxpt.ComponentCount - 1 do\n  begin\n    if TComponent(frxpt.Components[i]) is TfrxRichView then\n      (TComponent(frxpt.Components[i]) as TfrxRichView).Wysiwyg := mainunit.Print_Wysiwyg;\n    if TComponent(frxpt.Components[i]) is TfrxMemoView then\n    begin\n      (TComponent(frxpt.Components[i]) as TfrxMemoView).Wysiwyg := mainunit.Print_Wysiwyg;\n      if docharset then\n      begin\n        (TComponent(frxpt.Components[i]) as TfrxMemoView).font.Charset := charsetindex;\n        if (TComponent(frxpt.Components[i]) as TfrxMemoView).Name &lt;&gt; 'hostname' then\n          (TComponent(frxpt.Components[i]) as TfrxMemoView).font.name := fname;\n      end;\n    end;\n  end;\n \n \n \n  filepath :=SPath.LocalPath+ dm.mqryimagepath.AsString;\n  filepath:=StringReplace(filepath,'\\\\','\\',[rfReplaceAll]) ;\n  Exportpath:=filepath;\n  if FileExists(filepath + '\\rpt1.jpg') then\n    picconter := picconter + 1;\n  if FileExists(filepath + '\\rpt2.jpg') then\n    picconter := picconter + 1;\n  if FileExists(filepath + '\\rpt3.jpg') then\n    picconter := picconter + 1;\n  if FileExists(filepath + '\\rpt4.jpg') then\n    picconter := picconter + 1;\n  if FileExists(filepath + '\\rpt5.jpg') then\n    picconter := picconter + 1;\n  if FileExists(filepath + '\\rpt6.jpg') then\n    picconter := picconter + 1;\n \n  rptformats := dm.mqryrep_format.AsString;\n  rptformats := StringReplace(rptformats, 'D:\\stusdata\\reportformat\\', '', [rfReplaceAll]);\n  if frxpt.FindObject('ReportTitle1') &lt;&gt; nil then\n    (frxpt.FindObject('ReportTitle1') as TfrxReportTitle).Tag := picconter;\n  if FileExists(filepath + '\\rpt1.jpg') then\n  begin\n    if frxpt.FindObject('Picture1') &lt;&gt; nil then\n      (frxpt.FindObject('Picture1') as TfrxPictureView).Picture.LoadFromFile(filepath + '\\rpt1.jpg');\n  end;\n  if FileExists(filepath + '\\rpt2.jpg') then\n  begin\n    if frxpt.FindObject('Picture2') &lt;&gt; nil then\n      (frxpt.FindObject('Picture2') as TfrxPictureView).Picture.LoadFromFile(filepath + '\\rpt2.jpg');\n  end;\n  if FileExists(filepath + '\\rpt3.jpg') then\n  begin\n    if frxpt.FindObject('Picture3') &lt;&gt; nil then\n      (frxpt.FindObject('Picture3') as TfrxPictureView).Picture.LoadFromFile(filepath + '\\rpt3.jpg');\n  end;\n  if FileExists(filepath + '\\rpt4.jpg') then\n  begin\n    if frxpt.FindObject('Picture4') &lt;&gt; nil then\n      (frxpt.FindObject('Picture4') as TfrxPictureView).Picture.LoadFromFile(filepath + '\\rpt4.jpg');\n  end;\n  if FileExists(filepath + '\\rpt5.jpg') then\n  begin\n    if frxpt.FindObject('Picture5') &lt;&gt; nil then\n      (frxpt.FindObject('Picture5') as TfrxPictureView).Picture.LoadFromFile(filepath + '\\rpt5.jpg');\n  end;\n  if FileExists(filepath + '\\rpt6.jpg') then\n  begin\n    if frxpt.FindObject('Picture6') &lt;&gt; nil then\n      (frxpt.FindObject('Picture6') as TfrxPictureView).Picture.LoadFromFile(filepath + '\\rpt6.jpg');\n  end;\n if  frxpt.FindObject('dbjinchasuojian')&lt;&gt; nil then\n    (frxpt.FindObject('dbjinchasuojian') as TfrxMemoView).Font.Size:=i_ReportSJTS_FontSize;\n if  frxpt.FindObject('dbjianchajielun')&lt;&gt; nil then\n    (frxpt.FindObject('dbjianchajielun') as TfrxMemoView).Font.Size:=i_ReportSJTS_FontSize;\n  if  frxpt.FindObject('Memo44')&lt;&gt; nil then\n    (frxpt.FindObject('Memo44') as TfrxMemoView).Font.Size:=i_ReportSJTS_FontSize;\n  if FileExists(filepath + '\\CeLiang.jpg') then\n  begin\n    if frxpt.FindObject('Picturecl') &lt;&gt; nil then\n      (frxpt.FindObject('Picturecl') as TfrxPictureView).Picture.LoadFromFile(filepath + '\\CeLiang.jpg');\n  end;\n\/\/  if frxpt.FindObject('PageFooter1')&lt;&gt; nil then\n\/\/     begin\n\/\/        if (frxpt.FindObject('Page1') as TfrxReportPage).PageCount&gt;1 then\n\/\/          begin\n\/\/            (frxpt.FindObject('PageFooter1') as TfrxPageFooter).PrintOnFirstPage:=False;\n\/\/            (frxpt.FindObject('PageFooter1') as TfrxPageFooter).PrintOnLastPage:=true;\n\/\/          end\n\/\/         else\n\/\/           begin\n\/\/             (frxpt.FindObject('PageFooter1') as TfrxPageFooter).PrintOnFirstPage:=true;\n\/\/            (frxpt.FindObject('PageFooter1') as TfrxPageFooter).PrintOnLastPage:=true;\n\/\/           end;\n\/\/\n\/\/     end;\n\/\/frxpt.Engine.\nend;<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>procedure Trepform.frxptBeforePrint(Sender: TfrxReportC [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":862,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"series":[],"class_list":{"0":"post-982","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-oldusdoc","9":"post-with-thumbnail","10":"post-with-thumbnail-large"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=982"}],"version-history":[{"count":1,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/982\/revisions"}],"predecessor-version":[{"id":983,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/982\/revisions\/983"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/media\/862"}],"wp:attachment":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=982"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}