1.设置打印只有打印或者打印及导出功能
/// <summary> /// 药卫模板预览 /// </summary> /// <param name="lstDicCircp">打印单据列表</param> /// <param name="dataSource">数据源</param> /// <param name="paramater">打印参数,可以为空</param> /// <param name="reportInEntity">AR报表实体</param> /// <param name="erroMsg">返回错误信息</param> /// <returns></returns> public bool DemPreview(List<DicCircp> lstDicCircp, Dictionary<string, object> dataSource, Dictionary<string, object> paramater, MzReport.ReportEntity reportInEntity, ref string erroMsg) { if (lstDicCircp?.FirstOrDefault() == null) { erroMsg = "未获取到预览信息"; return false; } if (reportInEntity == null) { reportInEntity = reportEntity; } var PreviewCircps = lstDicCircp.Where(d => d.DcrPrtoptCode == PrintingOpportunity.OnlyPreview.GetHashCode().ToString()).ToList(); if (PreviewCircps?.FirstOrDefault() != null) { foreach (var circpItem in PreviewCircps) { //只打印传MzReport.ToolStripMenus.Print; 打印及导出功能MzReport.ToolStripMenus.PrintAndExport FrmReportPreview.Preview(reportInEntity, circpItem, dataSource, paramater, circpItem.DcrName + "预览", MzReport.ToolStripMenus.PrintAndExport); } } return true; }
2.打印窗体位置:程序集CoreX.Components;
窗体FrmReportPreview