看下面代码
if trim(Edit1.Text)='' then
begin
ShowMessage('您没有输入病历编号,不能打印和预览!');
exit;
end;
ReportCheckFrm.QRImage1.Picture.Assign(imageForm.Image2.Picture);
ReportCheckFrm.QRImage2.Picture.Bitmap.Assign(imageForm.Image1.Picture.Bitmap);
ReportCheckFrm.Refresh;
ReportCheckFrm.Query1.close;
//此处加入定位语句,用filter或重写sql
ReportCheckFrm.Query1.SQL.Clear;
ReportCheckFrm.Query1.SQL.Text :='SELECT mainID, Name, Sex, Age, '+
' InHospitalDate, Married, Occupation, OriginalPlace, Address, '+
' ZipCode, WorkingDepartment, DescriberName, Reliablity, '+
' MainDiscription, CurrentMorbidity, DiseaseHistory, '+
' Overview, PersonalHistory, FamilyHistory, '+
' PhysicalExamine, AssistantExamine, Diagnosis, '+
' TreatmentScheme FROM Pathography ';
ReportCheckFrm.Query1.SQL.Add(' Where mainID='''+trim(Edit1.Text)+'''');
ReportCheckFrm.Query1.open;
ReportCheckFrm.QRMemo1.Lines := DiagnosticResultFrm.Memo1.Lines;
ReportCheckFrm.QRMemo2.Lines := DiagnosticResultFrm.Memo2.Lines;
ReportCheckFrm.QRLabel1DoctorName.Caption :=DiagnosticResultFrm.EditDoctorName.text;
ReportCheckFrm.QRLabel26.Caption := trim(DiagnosticResultFrm.Edit1.text);
ReportCheckFrm.QRLabel27.Caption := trim(DiagnosticResultFrm.Edit2.text);
ReportCheckFrm.QRLabel28.Caption := trim(DiagnosticResultFrm.Edit3.text);
ReportCheckFrm.QRLabel29.Caption := trim(DiagnosticResultFrm.Edit4.text);
ReportCheckFrm.QRLabel30.Caption := trim(DiagnosticResultFrm.Edit5.text);
ReportCheckFrm.QRLabel31.Caption := trim(DiagnosticResultFrm.Edit6.text);
ReportCheckFrm.Refresh;
ReportCheckFrm.QRImage1.Refresh;
ReportCheckFrm.QRImage2.Refresh;
ReportCheckFrm.preview;
ReportCheckFrm.Query1.close;
有时会出现这种情况
在用delphi调试时可能资源不够图片不能显示出来, 但是打印是正确的。
如果用编译后的程序则没有问题