public void printPreview(PrinteModel model) { if (model != null) { printModel = model; } else { return; } try { init(); PrintPreviewDialog previewDialog = new PrintPreviewDialog(); previewDialog.Document = docToPrint; var result = previewDialog.ShowDialog(); if (result == DialogResult.OK) { docToPrint.Print(); } } catch (Exception ex) { } }
public void print(PrinteModel model) { //SetCurrentMember(regcode); if (model != null) { printModel = model; } else { return; } try { init(); docToPrint.Print(); } catch (Exception ex) { //logger.Error(ex.Message); } }