using DevExpress.XtraPrinting; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace HL_FristAidPlatform_Public { public partial class Form_BedsideCard : Form { public string name; public string gender; public string age; public string diagnose; public string time; public Form_BedsideCard(string _name, string _gender, string _age, string _diagnose, string _time) { InitializeComponent(); name = _name; gender = _gender; age = _age; diagnose = _diagnose; time = _time; } private void simpleButton_Print_Click(object sender, EventArgs e) { PrintingSystem ps = new PrintingSystem(); PrintableComponentLink link = new PrintableComponentLink(ps); link.Component = layoutControl1; ps.Links.Add(link); link.CreateDocument(); ps.PreviewFormEx.Show(); } private void Form_BedsideCard_Load(object sender, EventArgs e) { labelControl_Name.Text = name; labelControl_Gender.Text = gender; dateTimePicker1.Text = time; labelControl_Age.Text = age; textBox4.Text = diagnose; } } }