报告自助打印程序

代码片段

using FastReport;
using FastReport.Export.Pdf;
using FastReport.Export.Image;
using FastReport.Data;
using FastReport.Format;

FastReport.Report report = new FastReport.Report();
string filename = @”2.frx”;
report.Load(filename);
report.SetParameterValue(“FastReport.PatientID”, PatientID); //传递参数
report.SetParameterValue(“FastReport.ChineseName”, ChineseName);
report.SetParameterValue(“FastReport.Age”, Age);
report.SetParameterValue(“FastReport.AgeUnit”, AgeUnit);
report.SetParameterValue(“FastReport.PatientSex”, PatientSex);
report.SetParameterValue(“FastReport.Birthdate”, Birthdate);

report.SetParameterValue(“FastReport.StayInsu”, StayInsu);
report.SetParameterValue(“FastReport.ReqDoctor”, ReqDoctor);
report.SetParameterValue(“FastReport.ReqOffice”, ReqOffice);
report.SetParameterValue(“FastReport.Area”, Area);
report.SetParameterValue(“FastReport.InPatientNo”, InPatientNo);
report.SetParameterValue(“FastReport.BedNo”, BedNo);

report.SetParameterValue(“FastReport.ExamineRoom”, ExamineRoom);
report.SetParameterValue(“FastReport.Modality”, Modality);
report.SetParameterValue(“FastReport.AccessionNumber”, AccessionNumber);
report.SetParameterValue(“FastReport.ExamineItem”, ExamineItem);
report.SetParameterValue(“FastReport.ExaminePart”, ExaminePart);
report.SetParameterValue(“FastReport.ExamineDoctor”, ExamineDoctor);

report.SetParameterValue(“FastReport.Findings”, Findings);
report.SetParameterValue(“FastReport.Diagnosis”, Diagnosis);
report.SetParameterValue(“FastReport.ExamineEnd”, ExamineEnd);
report.SetParameterValue(“FastReport.WriteDoctor”, WriteDoctor);
report.SetParameterValue(“FastReport.WriteEnd”, ExamineEnd);

PictureObject onePicture = report.FindObject(“Picture1”) as PictureObject; //在模板查找控件
onePicture.ImageLocation = ImageURL1;//给控件赋值
PictureObject towPicture = report.FindObject(“Picture2”) as PictureObject; //在模板查找控件
towPicture.ImageLocation = ImageURL2;//给控件赋值
report.Show();//打印预览

下载地址:

链接: https://pan.baidu.com/s/1dFJ3V7z

密码: rss5

打赏
如果有其他或更好的解决方案请留言

文章来自: http://apan.me/2017/06/selfprint-2

此条目发表在程序开发分类目录。将固定链接加入收藏夹。

发表评论