private void btnPrint_Click(object sender, EventArgs e) { if (PEMRBusinessLogic.ActivePEMRObject == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_Medication == null || PEMRBusinessLogic.ActivePEMRObject.List_VisitTiming_Medication.Count == 0) { XtraMessageBox.Show("No Medications are added", " Note", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } PEMR_HeaderAndFooterTemplate_A5_rpt templateReport = new PEMR_HeaderAndFooterTemplate_A5_rpt(); PEMR_ElementContainer_A5_rpt elementContainer = new PEMR_ElementContainer_A5_rpt(); List <PEMR_Translated> list = PEMRBusinessLogic.Translate_PEMR_Condensed(PEMRBusinessLogic.ActivePEMRObject, DB_PEMR_ElementType.VisitTiming_Medications); elementContainer.Initialize(list, DB_PEMR_ElementType.VisitTiming_Medications); templateReport = PEMR_HeaderAndFooterTemplate_A5_rpt.Initialize(elementContainer, true); using (ReportPrintTool reprotTool = new ReportPrintTool(templateReport)) reprotTool.PrintDialog(); }