private void butPrint_Click(object sender, EventArgs e) { if (gridMain.Rows.Count < 1) { MsgBox.Show(this, "Supply list is Empty."); return; } pagesPrinted = 0; headingPrinted = false; pd2 = new PrintDocument(); pd2.DefaultPageSettings.Margins = new Margins(50, 50, 40, 30); pd2.PrintPage += new PrintPageEventHandler(pd2_PrintPage); if (pd2.DefaultPageSettings.PrintableArea.Height == 0) { pd2.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd2; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd2, PrintSituation.Default, 0, "Supplies list printed")) { try{ pd2.Print(); } catch { MsgBox.Show(this, "Printer not available"); } } #endif }
private void butPrint_Click(object sender, EventArgs e) { _pagesPrintedCount = 0; PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 50, 50); //pd.OriginAtMargins=true; pd.DefaultPageSettings.Landscape = false; if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } _isHeadingPrinted = false; try { #if DEBUG FormRpPrintPreview formPreview = new FormRpPrintPreview(); formPreview.printPreviewControl2.Document = pd; formPreview.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default, 0, "Electronic remittance advice (ERA) printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } }
private void butPrint_Click(object sender, EventArgs e) { PrintDocument pd = new PrintDocument(); //TODO: Implement ODprintout pattern - MigraDoc if (!PrinterL.SetPrinter(pd, PrintSituation.Default, 0, "Reconcile list printed")) { return; //User cancelled. } pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } MigraDoc.DocumentObjectModel.Document doc = CreatePrintDocument(pd); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc = new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer = new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.PrinterSettings = pd.PrinterSettings; printdoc.Renderer = renderer; #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(printdoc); pView.ShowDialog(); #else printdoc.Print(); #endif }
private void butPrint_Click(object sender, EventArgs e) { pd2 = new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPage); pd2.DefaultPageSettings.Margins = new Margins(75, 75, 50, 100); if (pd2.DefaultPageSettings.PrintableArea.Height == 0) { pd2.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } linesPrinted = 0; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd2; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd2, PrintSituation.Default, EtransCur.PatNum, "Etrans message text from " + EtransCur.DateTimeTrans.ToShortDateString() + " printed")) { pd2.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } EtransCur.Note = Lan.g(this, "Printed") + textNote.Text; Etranss.Update(EtransCur); DialogResult = DialogResult.OK; }
private void butPrint_Click(object sender, EventArgs e) { pagesPrinted = 0; pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); //pd.OriginAtMargins=true; if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } headingPrinted = false; #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (!PrinterL.SetPrinter(pd, PrintSituation.Default)) { return; } try{ pd.Print(); } catch { MsgBox.Show(this, "Printer not available"); } #endif }
private void butPrint_Click(object sender, EventArgs e) { _pagesPrinted = 0; PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); pd.DefaultPageSettings.Landscape = true; if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } _headingPrinted = false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default, 0, "Incomplete Procedure Notes report printed")) { pd.Print(); } #endif } catch (Exception ex) { FriendlyException.Show(Lan.g(this, "Printer not available"), ex); } }
private void butPrint_Click(object sender, EventArgs e) { _pagesPrinted = 0; PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } if (gridMain.WidthAllColumns > 800) { //a new feature will need to be implemented to handle when columns widths are greater than 1050 pd.DefaultPageSettings.Landscape = true; } _headingPrinted = false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default, 0, "Ortho chart printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } }
//Copied from FormRpOutstandingIns.cs private void butPrint_Click(object sender, EventArgs e) { _pagesPrinted = 0; PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); //pd.DefaultPageSettings.Landscape=!checkIgnoreCustom.Checked;//If we are including custom tracking, print in landscape mode. if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } _headingPrinted = false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default, 0, "Outstanding insurance report printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } }
private void butPrint_Click(object sender, EventArgs e) { pagesPrinted = 0; PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); //pd.OriginAtMargins=true; pd.DefaultPageSettings.Landscape = false; if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } headingPrinted = false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default, 0, "Referred procedure tracking list printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } }
private void butPrint_Click(object sender, EventArgs e) { if (_tableOrderItems.Rows.Count < 1) { MsgBox.Show(this, "Supply list is Empty."); return; } _pagesPrinted = 0; _headingPrinted = false; _pd2 = new PrintDocument(); _pd2.DefaultPageSettings.Margins = new Margins(50, 50, 40, 30); _pd2.PrintPage += new PrintPageEventHandler(pd2_PrintPage); if (_pd2.DefaultPageSettings.PrintableArea.Height == 0) { _pd2.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = _pd2; pView.ShowDialog(); #else if (PrinterL.SetPrinter(_pd2, PrintSituation.Default, 0, "Supplies order from " + _listOrders[gridOrders.GetSelectedIndex()].DatePlaced.ToShortDateString() + " printed")) { try{ _pd2.Print(); } catch { MsgBox.Show(this, "Printer not available"); } } #endif }
///<summary>Preview is only used for debugging.</summary> public void PrintReport(bool justPreview) { pd2 = new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPage); pd2.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0); pd2.OriginAtMargins = true; if (pd2.DefaultPageSettings.PaperSize.Height == 0) { pd2.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } headingPrinted = false; //isPrinting=true; //FillGrid(); try { if (justPreview) { FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd2; pView.ShowDialog(); } else { if (Printers.SetPrinter(pd2, PrintSituation.Default)) { pd2.Print(); } } } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } //isPrinting=false; }
private void butPrint_Click(object sender, EventArgs e) { //only visible in Message mode. pagesPrinted = 0; PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 80); //pd.OriginAtMargins=true; if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } headingPrinted = false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default, EtransCur.PatNum, "Electronic benefit request from " + EtransCur.DateTimeTrans.ToShortDateString() + " printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } }
///<summary>Preview is only used for debugging.</summary> public void PrintReport(bool justPreview) { pd2 = new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPage); pd2.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0); pd2.OriginAtMargins = true; if (pd2.DefaultPageSettings.PrintableArea.Height == 0) { pd2.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } isPrinting = true; FillGrid(); try { if (justPreview) { FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd2; pView.ShowDialog(); } else { if (PrinterL.SetPrinter(pd2, PrintSituation.Default, 0, "Accounting transaction history for " + AccountCur.Description + " printed")) { pd2.Print(); } } } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } isPrinting = false; FillGrid(); }
private void butPrint_Click(object sender, EventArgs e) { PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); //pd.OriginAtMargins=true; if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (!PrinterL.SetPrinter(pd, PrintSituation.Default, 0, "Printed patient list from EHR")) { return; } try{ pd.Print(); } catch (Exception ex) { MessageBox.Show(ex.Message); } #endif }
private void PrintPatientInfo() { PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default, _patCur.PatNum, "Patient portal login information printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } }
///<summary>Launches FormRpPrintPreview for the given printDoc. Returns true if dialog result was OK; Otherwise false.</returns> private static bool RpPreview(ODprintout printout) { if (ControlPreviewOverride != null) { return(IsControlPreviewOverrideValid(printout)); } FormRpPrintPreview formPreview = new FormRpPrintPreview(printout); formPreview.ShowDialog(); formPreview.BringToFront(); return(formPreview.DialogResult == DialogResult.OK); }
private void PrintReceipt(string receiptStr) { string[] receiptLines = receiptStr.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); MigraDoc.DocumentObjectModel.Document doc = new MigraDoc.DocumentObjectModel.Document(); doc.DefaultPageSetup.PageWidth = Unit.FromInch(3.0); doc.DefaultPageSetup.PageHeight = Unit.FromInch(0.181 * receiptLines.Length + 0.56); //enough to print receipt text plus 9/16 inch (0.56) extra space at bottom. doc.DefaultPageSetup.TopMargin = Unit.FromInch(0.25); doc.DefaultPageSetup.LeftMargin = Unit.FromInch(0.25); doc.DefaultPageSetup.RightMargin = Unit.FromInch(0.25); MigraDoc.DocumentObjectModel.Font bodyFontx = MigraDocHelper.CreateFont(8, false); bodyFontx.Name = FontFamily.GenericMonospace.Name; MigraDoc.DocumentObjectModel.Section section = doc.AddSection(); Paragraph par = section.AddParagraph(); ParagraphFormat parformat = new ParagraphFormat(); parformat.Alignment = ParagraphAlignment.Left; parformat.Font = bodyFontx; par.Format = parformat; par.AddFormattedText(receiptStr, bodyFontx); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc = new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer = new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.Renderer = renderer; #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(printdoc); pView.ShowDialog(); #else try { ODprintout printout = PrinterL.CreateODprintout( printSit: PrintSituation.Receipt, auditPatNum: _patCur.PatNum, auditDescription: Lans.g(this, "PayConnect receipt printed") ); if (PrinterL.TrySetPrinter(printout)) { printdoc.PrinterSettings = printout.PrintDoc.PrinterSettings; printdoc.Print(); } } catch (Exception ex) { MessageBox.Show(Lan.g(this, "Printer not available.") + "\r\n" + Lan.g(this, "Original error") + ": " + ex.Message); } #endif }
private void butPrint_Click(object sender, EventArgs e) { if (tabControl.SelectedIndex == 1 && gridOrder.GetSelectedIndex() == -1) { MsgBox.Show(this, "Please select an order first."); return; } if (tabControl.SelectedIndex == 0 && gridSupplyMain.Rows.Count == 0) { MsgBox.Show(this, "The list is empty."); return; } pagesPrinted = 0; headingPrinted = false; pd2 = new PrintDocument(); pd2.DefaultPageSettings.Margins = new Margins(50, 50, 40, 30); if (tabControl.SelectedIndex == 0) //main list { pd2.PrintPage += new PrintPageEventHandler(pd2_PrintPageMain); } else //one order { pd2.PrintPage += new PrintPageEventHandler(pd2_PrintPageOrder); } if (pd2.DefaultPageSettings.PrintableArea.Height == 0) { pd2.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd2; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd2, PrintSituation.Default)) { try{ pd2.Print(); } catch { MsgBox.Show(this, "Printer not available"); } } #endif }
private void butPrint_Click(object sender, EventArgs e) { MigraDoc.DocumentObjectModel.Document doc = CreatePrintDocument(); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc = new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer = new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.Renderer = renderer; #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = printdoc; pView.ShowDialog(); #else //Always prints to the Windows default printer. if (PrinterL.SetPrinter(pd2, PrintSituation.Default, 0, "Reconcile list printed")) { printdoc.Print(); } #endif }
private void butPrint_Click(object sender, EventArgs e) { if (textOnlineLink.Text == "") { MsgBox.Show(this, "Online Access Link required. Please press Get Link."); return; } if (textOnlinePassword.Text == "") { MessageBox.Show("Password required. Please generate a new password."); return; } if (!PasswordIsValid()) //this gives a messagebox if invalid { return; } //Then, print the info that the patient will be given in order for them to log in online. PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } try { #if !DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default)) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } }
private void PrintReceipt(string receiptStr) { string[] receiptLines = receiptStr.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); MigraDoc.DocumentObjectModel.Document doc = new MigraDoc.DocumentObjectModel.Document(); doc.DefaultPageSetup.PageWidth = Unit.FromInch(3.0); doc.DefaultPageSetup.PageHeight = Unit.FromInch(0.181 * receiptLines.Length + 0.56); //enough to print receipt text plus 9/16 inch (0.56) extra space at bottom. doc.DefaultPageSetup.TopMargin = Unit.FromInch(0.25); doc.DefaultPageSetup.LeftMargin = Unit.FromInch(0.25); doc.DefaultPageSetup.RightMargin = Unit.FromInch(0.25); MigraDoc.DocumentObjectModel.Font bodyFontx = MigraDocHelper.CreateFont(8, false); bodyFontx.Name = FontFamily.GenericMonospace.Name; MigraDoc.DocumentObjectModel.Section section = doc.AddSection(); Paragraph par = section.AddParagraph(); ParagraphFormat parformat = new ParagraphFormat(); parformat.Alignment = ParagraphAlignment.Left; parformat.Font = bodyFontx; par.Format = parformat; par.AddFormattedText(receiptStr, bodyFontx); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc = new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer = new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.Renderer = renderer; //we might want to surround some of this with a try-catch #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = printdoc; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd2, PrintSituation.Receipt, PatCur.PatNum, "PayConnect receipt printed")) { printdoc.PrinterSettings = pd2.PrinterSettings; printdoc.Print(); } #endif }
private void butPrint_Click(object sender,EventArgs e) { if(tableOrderItems.Rows.Count<1) { MsgBox.Show(this,"Supply list is Empty."); return; } pagesPrinted=0; headingPrinted=false; pd2=new PrintDocument(); pd2.DefaultPageSettings.Margins=new Margins(50,50,40,30); pd2.PrintPage+=new PrintPageEventHandler(pd2_PrintPage); if(pd2.DefaultPageSettings.PrintableArea.Height==0) { pd2.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } #if DEBUG FormRpPrintPreview pView=new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd2; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd2,PrintSituation.Default,0,"Supplies order from "+ListOrders[gridOrders.GetSelectedIndex()].DatePlaced.ToShortDateString()+" printed")) { try{ pd2.Print(); } catch{ MsgBox.Show(this,"Printer not available"); } } #endif }
private void butPrint_Click(object sender,EventArgs e) { PrintDocument pd=new PrintDocument(); if(!PrinterL.SetPrinter(pd,PrintSituation.Default,0,"Reconcile list printed")) { return;//User cancelled. } pd.DefaultPageSettings.Margins=new Margins(25,25,40,40); if(pd.DefaultPageSettings.PrintableArea.Height==0) { pd.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } MigraDoc.DocumentObjectModel.Document doc=CreatePrintDocument(pd); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc=new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer=new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.PrinterSettings=pd.PrinterSettings; printdoc.Renderer=renderer; #if DEBUG FormRpPrintPreview pView=new FormRpPrintPreview(); pView.printPreviewControl2.Document=printdoc; pView.ShowDialog(); #else printdoc.Print(); #endif }
///<summary>Preview is only used for debugging.</summary> public void PrintReport(bool justPreview) { pd2=new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPage); pd2.DefaultPageSettings.Margins=new Margins(0,0,0,0); pd2.OriginAtMargins=true; if(pd2.DefaultPageSettings.PrintableArea.Height==0) { pd2.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } headingPrinted=false; //isPrinting=true; //FillGrid(); try { if(justPreview) { FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd2; pView.ShowDialog(); } else { if(PrinterL.SetPrinter(pd2,PrintSituation.Default,0,"Claim history list printed")) { pd2.Print(); } } } catch { MessageBox.Show(Lan.g(this,"Printer not available")); } //isPrinting=false; }
private void butPrint_Click(object sender,EventArgs e) { pagesPrinted=0; pd=new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins=new Margins(25,25,40,40); //pd.OriginAtMargins=true; if(pd.DefaultPageSettings.PrintableArea.Height==0) { pd.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } headingPrinted=false; #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd; pView.ShowDialog(); #else if(!PrinterL.SetPrinter(pd,PrintSituation.Default,0,"Unscheduled appointment list printed")) { return; } try{ pd.Print(); } catch { MsgBox.Show(this,"Printer not available"); } #endif }
private void butPrint_Click(object sender,EventArgs e) { if(textOnlineLink.Text=="") { MsgBox.Show(this,"Online Access Link required. Please press Get Link."); return; } if(textOnlinePassword.Text==""){ MessageBox.Show("Password required. Please generate a new password."); return; } if(!PasswordIsValid()) {//this gives a messagebox if invalid return; } //Then, print the info that the patient will be given in order for them to log in online. PrintDocument pd=new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins=new Margins(25,25,40,40); if(pd.DefaultPageSettings.PrintableArea.Height==0) { pd.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } try { #if !DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd,PrintSituation.Default)) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this,"Printer not available")); } }
private void butPrint_Click(object sender,EventArgs e) { ////Validating of parameters is done during RefreshGrid(). //ReportSimpleGrid report=new ReportSimpleGrid(); //report.Query = "SELECT carrier.CarrierName,patient.HmPhone,claim.ClaimType,patient.FName,patient.LName,patient.MiddleI,patient.PatNum,claim.DateService,claim.DateSent,claim.ClaimFee,claim.ClaimNum " // +"FROM carrier,patient,claim,insplan " // +"WHERE carrier.CarrierNum = insplan.CarrierNum " // +"AND claim.PlanNum = insplan.PlanNum " // +"AND claim.PatNum = patient.PatNum " // +"AND claim.ClaimStatus='S' "; //if(dateMin!=DateTime.MinValue) { // report.Query+="AND claim.DateSent <= "+POut.Date(dateMin)+" "; //} //if(dateMax!=DateTime.MinValue) { // report.Query+="AND claim.DateSent >= "+POut.Date(dateMax)+" "; //} //if(!isAllProv) { // if(provNumList.Count>0) { // report.Query+="AND claim.ProvBill IN ("; // report.Query+=""+provNumList[0]; // for(int i=1;i<provNumList.Count;i++) { // report.Query+=","+provNumList[i]; // } // report.Query+=") "; // } //} //if(!isPreauth) { // report.Query+="AND claim.ClaimType!='Preauth' "; //} //report.Query+="ORDER BY carrier.Phone,insplan.PlanNum, carrier.Phone,insplan.PlanNum"; //FormQuery FormQuery2=new FormQuery(report); //FormQuery2.IsReport=true; //DataTable tableTemp= report.GetTempTable(); //report.TableQ=new DataTable(null);//new table no name //for(int i=0;i<6;i++) {//add columns // report.TableQ.Columns.Add(new System.Data.DataColumn());//blank columns //} //report.InitializeColumns(); //for(int i=0;i<tableTemp.Rows.Count;i++) {//loop through data rows // DataRow row = report.TableQ.NewRow();//create new row called 'row' based on structure of TableQ // //start filling 'row'. First column is carrier: // row[0]=tableTemp.Rows[i][0]; // row[1]=tableTemp.Rows[i][7]; // if(PIn.String(tableTemp.Rows[i][2].ToString())=="P") // row[2]="Primary"; // if(PIn.String(tableTemp.Rows[i][2].ToString())=="S") // row[2]="Secondary"; // if(PIn.String(tableTemp.Rows[i][2].ToString())=="PreAuth") // row[2]="PreAuth"; // if(PIn.String(tableTemp.Rows[i][2].ToString())=="Other") // row[2]="Other"; // row[3]=tableTemp.Rows[i][4]; // row[4]=(PIn.Date(tableTemp.Rows[i][3].ToString())).ToString("d"); // row[5]=PIn.Double(tableTemp.Rows[i][6].ToString()).ToString("F"); // //TimeSpan d = DateTime.Today.Subtract((PIn.PDate(tableTemp.Rows[i][5].ToString()))); // //if(d.Days>5000) // // row[4]=""; // //else // // row[4]=d.Days.ToString(); // report.ColTotal[5]+=PIn.Double(tableTemp.Rows[i][6].ToString()); // report.TableQ.Rows.Add(row); //} //FormQuery2.ResetGrid();//this is a method in FormQuery; //report.Title="OUTSTANDING INSURANCE CLAIMS"; //report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle)); //report.SubTitle.Add("Sent before "+dateMin.Date.ToShortDateString()); //report.ColPos[0]=20; //report.ColPos[1]=210; //report.ColPos[2]=330; //report.ColPos[3]=430; //report.ColPos[4]=600; //report.ColPos[5]=690; //report.ColPos[6]=770; //report.ColCaption[0]=Lan.g(this,"Carrier"); //report.ColCaption[1]=Lan.g(this,"Phone"); //report.ColCaption[2]=Lan.g(this,"Type"); //report.ColCaption[3]=Lan.g(this,"Patient Name"); //report.ColCaption[4]=Lan.g(this,"Date of Service"); //report.ColCaption[5]=Lan.g(this,"Amount"); //report.ColAlign[5]=HorizontalAlignment.Right; //FormQuery2.ShowDialog(); //DialogResult=DialogResult.OK; pagesPrinted=0; PrintDocument pd=new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins=new Margins(25,25,40,40); //pd.OriginAtMargins=true; pd.DefaultPageSettings.Landscape=false; if(pd.DefaultPageSettings.PrintableArea.Height==0) { pd.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } headingPrinted=false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd,PrintSituation.Default)) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this,"Printer not available")); } }
private void ToolBarMainPrint_Click() { if(PrefC.GetBool(PrefName.FuchsOptionsOn)) { if(checkShowDiscount.Checked || checkShowIns.Checked) { if(MessageBox.Show(this,string.Format(Lan.g(this,"Do you want to remove insurance estimates and PPO discounts from printed treatment plan?")),"Open Dental",MessageBoxButtons.YesNo,MessageBoxIcon.Question) != DialogResult.No) { checkShowDiscount.Checked=false; checkShowIns.Checked=false; FillMain(); } } } PrepImageForPrinting(); MigraDoc.DocumentObjectModel.Document doc=CreateDocument(); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc=new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer=new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.Renderer=renderer; //we might want to surround some of this with a try-catch #if DEBUG pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=printdoc; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd2,PrintSituation.TPPerio,PatCur.PatNum,"Treatment plan for printed")){ printdoc.PrinterSettings=pd2.PrinterSettings; printdoc.Print(); } #endif }
///<summary>Preview is only used for debugging.</summary> public void PrintDay(bool justPreview) { pd2=new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPageDay); pd2.DefaultPageSettings.Margins=new Margins(0,0,0,0); pd2.OriginAtMargins=true; if(pd2.DefaultPageSettings.PrintableArea.Height==0) { pd2.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } try { if(justPreview) { FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd2; pView.ShowDialog(); } else { if(PrinterL.SetPrinter(pd2,PrintSituation.Default,PatCur.PatNum,"Day report for hospital printed")) { pd2.Print(); } } } catch { MessageBox.Show(Lan.g(this,"Printer not available")); } }
private void butPrint_Click(object sender, EventArgs e) { ////Validating of parameters is done during RefreshGrid(). //ReportSimpleGrid report=new ReportSimpleGrid(); //report.Query = "SELECT carrier.CarrierName,patient.HmPhone,claim.ClaimType,patient.FName,patient.LName,patient.MiddleI,patient.PatNum,claim.DateService,claim.DateSent,claim.ClaimFee,claim.ClaimNum " // +"FROM carrier,patient,claim,insplan " // +"WHERE carrier.CarrierNum = insplan.CarrierNum " // +"AND claim.PlanNum = insplan.PlanNum " // +"AND claim.PatNum = patient.PatNum " // +"AND claim.ClaimStatus='S' "; //if(dateMin!=DateTime.MinValue) { // report.Query+="AND claim.DateSent <= "+POut.Date(dateMin)+" "; //} //if(dateMax!=DateTime.MinValue) { // report.Query+="AND claim.DateSent >= "+POut.Date(dateMax)+" "; //} //if(!isAllProv) { // if(provNumList.Count>0) { // report.Query+="AND claim.ProvBill IN ("; // report.Query+=""+provNumList[0]; // for(int i=1;i<provNumList.Count;i++) { // report.Query+=","+provNumList[i]; // } // report.Query+=") "; // } //} //if(!isPreauth) { // report.Query+="AND claim.ClaimType!='Preauth' "; //} //report.Query+="ORDER BY carrier.Phone,insplan.PlanNum, carrier.Phone,insplan.PlanNum"; //FormQuery FormQuery2=new FormQuery(report); //FormQuery2.IsReport=true; //DataTable tableTemp= report.GetTempTable(); //report.TableQ=new DataTable(null);//new table no name //for(int i=0;i<6;i++) {//add columns // report.TableQ.Columns.Add(new System.Data.DataColumn());//blank columns //} //report.InitializeColumns(); //for(int i=0;i<tableTemp.Rows.Count;i++) {//loop through data rows // DataRow row = report.TableQ.NewRow();//create new row called 'row' based on structure of TableQ // //start filling 'row'. First column is carrier: // row[0]=tableTemp.Rows[i][0]; // row[1]=tableTemp.Rows[i][7]; // if(PIn.String(tableTemp.Rows[i][2].ToString())=="P") // row[2]="Primary"; // if(PIn.String(tableTemp.Rows[i][2].ToString())=="S") // row[2]="Secondary"; // if(PIn.String(tableTemp.Rows[i][2].ToString())=="PreAuth") // row[2]="PreAuth"; // if(PIn.String(tableTemp.Rows[i][2].ToString())=="Other") // row[2]="Other"; // row[3]=tableTemp.Rows[i][4]; // row[4]=(PIn.Date(tableTemp.Rows[i][3].ToString())).ToString("d"); // row[5]=PIn.Double(tableTemp.Rows[i][6].ToString()).ToString("F"); // //TimeSpan d = DateTime.Today.Subtract((PIn.PDate(tableTemp.Rows[i][5].ToString()))); // //if(d.Days>5000) // // row[4]=""; // //else // // row[4]=d.Days.ToString(); // report.ColTotal[5]+=PIn.Double(tableTemp.Rows[i][6].ToString()); // report.TableQ.Rows.Add(row); //} //FormQuery2.ResetGrid();//this is a method in FormQuery; //report.Title="OUTSTANDING INSURANCE CLAIMS"; //report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle)); //report.SubTitle.Add("Sent before "+dateMin.Date.ToShortDateString()); //report.ColPos[0]=20; //report.ColPos[1]=210; //report.ColPos[2]=330; //report.ColPos[3]=430; //report.ColPos[4]=600; //report.ColPos[5]=690; //report.ColPos[6]=770; //report.ColCaption[0]=Lan.g(this,"Carrier"); //report.ColCaption[1]=Lan.g(this,"Phone"); //report.ColCaption[2]=Lan.g(this,"Type"); //report.ColCaption[3]=Lan.g(this,"Patient Name"); //report.ColCaption[4]=Lan.g(this,"Date of Service"); //report.ColCaption[5]=Lan.g(this,"Amount"); //report.ColAlign[5]=HorizontalAlignment.Right; //FormQuery2.ShowDialog(); //DialogResult=DialogResult.OK; pagesPrinted = 0; PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins = new Margins(25, 25, 40, 40); //pd.OriginAtMargins=true; pd.DefaultPageSettings.Landscape = false; if (pd.DefaultPageSettings.PrintableArea.Height == 0) { pd.DefaultPageSettings.PaperSize = new PaperSize("default", 850, 1100); } headingPrinted = false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document = pd; pView.ShowDialog(); #else if (PrinterL.SetPrinter(pd, PrintSituation.Default, 0, "Outstanding insurance report printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this, "Printer not available")); } }
private void ToolBarMainPrint_Click() { if(PrefC.GetBool(PrefName.FuchsOptionsOn)) { if(checkShowDiscount.Checked || checkShowIns.Checked) { if(MessageBox.Show(this,string.Format(Lan.g(this,"Do you want to remove insurance estimates and discounts from printed treatment plan?")),"Open Dental",MessageBoxButtons.YesNo,MessageBoxIcon.Question) != DialogResult.No) { checkShowDiscount.Checked=false; checkShowIns.Checked=false; FillMain(); } } } PrepImageForPrinting(); MigraDoc.DocumentObjectModel.Document doc=CreateDocument(); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc=new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer=new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.Renderer=renderer; //we might want to surround some of this with a try-catch #if DEBUG pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=printdoc; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd2,PrintSituation.TPPerio,PatCur.PatNum,"Treatment plan for printed")){ printdoc.PrinterSettings=pd2.PrinterSettings; printdoc.Print(); } #endif long category=0; OpenDentBusiness.Document docSave = new OpenDentBusiness.Document(); MigraDoc.Rendering.PdfDocumentRenderer pdfRenderer = new MigraDoc.Rendering.PdfDocumentRenderer(false,PdfFontEmbedding.Always); pdfRenderer.Document=CreateDocument(); pdfRenderer.RenderDocument(); //Check if there are any image category definitions with "TreatPlans" for(int i=0;i<DefC.Short[(int)DefCat.ImageCats].Length;i++) { if((DefC.Short[(int)DefCat.ImageCats][i].ItemValue=="R" || DefC.Short[(int)DefCat.ImageCats][i].ItemValue=="XR") && PrefC.AtoZfolderUsed) { long docNum=Documents.Insert(docSave); category=DefC.Short[(int)DefCat.ImageCats][i].DefNum; string filePath=ImageStore.GetPatientFolder(PatCur,ImageStore.GetPreferredAtoZpath()); string fileName="TPArchive"+docSave.DocNum; //Then create a PDF and save it to the AtoZ folder if AtoZ pref is on. byte[] rawData= { }; if(PrefC.AtoZfolderUsed) { if(filePath.EndsWith("\\")) { } else { filePath+="\\"; } pdfRenderer.Save(filePath+fileName+".pdf"); } //Currently never going to get hit because of AtoZ folder check above. This is due to AxAcroPDF functionality. else {//saving to db using(MemoryStream stream=new MemoryStream()) { pdfRenderer.Save(stream,false); rawData=stream.ToArray(); stream.Close(); } } docSave.ImgType=ImageType.Document; docSave.DateCreated=DateTime.Today; docSave.PatNum=PatCur.PatNum; docSave.DocCategory=category; docSave.Description=fileName; if(!PrefC.AtoZfolderUsed) { docSave.RawBase64=Convert.ToBase64String(rawData); } else { docSave.FileName=fileName+".pdf"; } Documents.Update(docSave);//creates filename and saves to db } } }
private void PrintPatientInfo() { PrintDocument pd=new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins=new Margins(25,25,40,40); if(pd.DefaultPageSettings.PrintableArea.Height==0) { pd.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd,PrintSituation.Default,PatCur.PatNum,"Patient portal login information printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this,"Printer not available")); } }
///<summary>Preview is only used for debugging.</summary> public void PrintReport(bool justPreview) { pd2=new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPage); //pd2.DefaultPageSettings.Margins=new Margins(50,50,40,25); if(pd2.DefaultPageSettings.PrintableArea.Height==0) { pd2.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } try{ if(justPreview){ FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd2; pView.ShowDialog(); } else{ if(PrinterL.SetPrinter(pd2,PrintSituation.Default)){ pd2.Print(); } } } catch{ MessageBox.Show(Lan.g(this,"Printer not available")); } }
private void PrintReceipt(string receiptStr) { string[] receiptLines=receiptStr.Split(new string[] { Environment.NewLine },StringSplitOptions.None); MigraDoc.DocumentObjectModel.Document doc=new MigraDoc.DocumentObjectModel.Document(); doc.DefaultPageSetup.PageWidth=Unit.FromInch(3.0); doc.DefaultPageSetup.PageHeight=Unit.FromInch(0.181*receiptLines.Length+0.56);//enough to print receipt text plus 9/16 inch (0.56) extra space at bottom. doc.DefaultPageSetup.TopMargin=Unit.FromInch(0.25); doc.DefaultPageSetup.LeftMargin=Unit.FromInch(0.25); doc.DefaultPageSetup.RightMargin=Unit.FromInch(0.25); MigraDoc.DocumentObjectModel.Font bodyFontx=MigraDocHelper.CreateFont(8,false); bodyFontx.Name=FontFamily.GenericMonospace.Name; MigraDoc.DocumentObjectModel.Section section=doc.AddSection(); Paragraph par=section.AddParagraph(); ParagraphFormat parformat=new ParagraphFormat(); parformat.Alignment=ParagraphAlignment.Left; parformat.Font=bodyFontx; par.Format=parformat; par.AddFormattedText(receiptStr,bodyFontx); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc=new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer=new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.Renderer=renderer; //we might want to surround some of this with a try-catch #if DEBUG FormRpPrintPreview pView=new FormRpPrintPreview(); pView.printPreviewControl2.Document=printdoc; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd2,PrintSituation.Receipt)){ printdoc.PrinterSettings=pd2.PrinterSettings; printdoc.Print(); } #endif }
private void butPrint_Click(object sender,EventArgs e) { _pagesPrinted=0; _headingPrinted=false; PrintDocument pd=new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins=new Margins(25,25,40,40); //pd.OriginAtMargins=true; if(pd.DefaultPageSettings.PrintableArea.Height==0) { pd.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd; pView.ShowDialog(); #else if(!PrinterL.SetPrinter(pd,PrintSituation.Default,0,"Printed patient list from EHR")) { return; } try{ pd.Print(); } catch(Exception ex){ MessageBox.Show(ex.Message); } #endif }
///<summary></summary> public void PrintReport() { pd2=new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPage); //pd2.DefaultPageSettings.Margins= new Margins(10,40,40,60); #if DEBUG pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd2; pView.ShowDialog(); #else if(!PrinterL.SetPrinter(pd2,PrintSituation.Appointments,0,"Daily appointment view for "+apptPrintStartTime.ToShortDateString()+" printed")){ return; } try{ pd2.Print(); } catch{ MessageBox.Show(Lan.g(this,"Printer not available")); } #endif }
private void butPrint_Click(object sender,EventArgs e) { if(tabControl.SelectedIndex==1 && gridOrder.GetSelectedIndex()==-1){ MsgBox.Show(this,"Please select an order first."); return; } if(tabControl.SelectedIndex==0 && gridSupplyMain.Rows.Count==0){ MsgBox.Show(this,"The list is empty."); return; } pagesPrinted=0; headingPrinted=false; pd2=new PrintDocument(); pd2.DefaultPageSettings.Margins=new Margins(50,50,40,30); if(tabControl.SelectedIndex==0){//main list pd2.PrintPage += new PrintPageEventHandler(pd2_PrintPageMain); } else{//one order pd2.PrintPage += new PrintPageEventHandler(pd2_PrintPageOrder); } if(pd2.DefaultPageSettings.PrintableArea.Height==0) { pd2.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd2; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd2,PrintSituation.Default)) { try{ pd2.Print(); } catch{ MsgBox.Show(this,"Printer not available"); } } #endif }
private void butPrint_Click(object sender,EventArgs e) { //only visible in Message mode. pagesPrinted=0; PrintDocument pd=new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins=new Margins(25,25,40,80); //pd.OriginAtMargins=true; if(pd.DefaultPageSettings.PrintableArea.Height==0) { pd.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } headingPrinted=false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd,PrintSituation.Default,EtransCur.PatNum,"Electronic benefit request from "+EtransCur.DateTimeTrans.ToShortDateString()+" printed")) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this,"Printer not available")); } }
private void butPrint_Click(object sender,EventArgs e) { MigraDoc.DocumentObjectModel.Document doc=CreatePrintDocument(); MigraDoc.Rendering.Printing.MigraDocPrintDocument printdoc=new MigraDoc.Rendering.Printing.MigraDocPrintDocument(); MigraDoc.Rendering.DocumentRenderer renderer=new MigraDoc.Rendering.DocumentRenderer(doc); renderer.PrepareDocument(); printdoc.Renderer=renderer; #if DEBUG FormRpPrintPreview pView=new FormRpPrintPreview(); pView.printPreviewControl2.Document=printdoc; pView.ShowDialog(); #else //Always prints to the Windows default printer. if(PrinterL.SetPrinter(pd2,PrintSituation.Default)){ printdoc.Print(); } #endif }
private void butPrint_Click(object sender,EventArgs e) { pd2=new PrintDocument(); pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPage); pd2.DefaultPageSettings.Margins=new Margins(75,75,50,100); if(pd2.DefaultPageSettings.PrintableArea.Height==0) { pd2.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } linesPrinted=0; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd2; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd2,PrintSituation.Default,EtransCur.PatNum,"Etrans message text from "+EtransCur.DateTimeTrans.ToShortDateString()+" printed")) { pd2.Print(); } #endif } catch { MessageBox.Show(Lan.g(this,"Printer not available")); } EtransCur.Note=Lan.g(this,"Printed")+textNote.Text; Etranss.Update(EtransCur); DialogResult=DialogResult.OK; }
private void butPrint_Click(object sender,EventArgs e) { pagesPrinted=0; PrintDocument pd=new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.DefaultPageSettings.Margins=new Margins(25,25,40,40); //pd.OriginAtMargins=true; pd.DefaultPageSettings.Landscape=false; if(pd.DefaultPageSettings.PrintableArea.Height==0) { pd.DefaultPageSettings.PaperSize=new PaperSize("default",850,1100); } headingPrinted=false; try { #if DEBUG FormRpPrintPreview pView = new FormRpPrintPreview(); pView.printPreviewControl2.Document=pd; pView.ShowDialog(); #else if(PrinterL.SetPrinter(pd,PrintSituation.Default)) { pd.Print(); } #endif } catch { MessageBox.Show(Lan.g(this,"Printer not available")); } }