Inheritance: PrintDocument
 private void btnPrint_Click(object sender, EventArgs e)
 {
     if (SetupThePrinting())
     {
         MyPrintDocument.Print();
     }
 }
Exemple #2
0
 private void tbn4Print_Click(object sender, EventArgs e)
 {
     if (SetupThePrinting("酒水日报表", this.dgv4Report))
     {
         MyPrintDocument.Print();
     }
 }
Exemple #3
0
 private void btn5Print_Click(object sender, EventArgs e)
 {
     if (SetupThePrinting("香烟日报表", this.dgv5Report))
     {
         MyPrintDocument.Print();
     }
 }
Exemple #4
0
 /// <summary>
 /// 打印进货历史记录
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn1Print_Click(object sender, EventArgs e)
 {
     if (SetupThePrinting("进货记录报表", this.dgv1Buy))
     {
         MyPrintDocument.Print();
     }
 }
Exemple #5
0
 /// <summary>
 /// 打印进货支出汇总
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn2Print_Click(object sender, EventArgs e)
 {
     if (SetupThePrinting("进货支出汇总", this.dgv2PaySum))
     {
         MyPrintDocument.Print();
     }
 }
 private void Btn_Aceptar_Click(object sender, EventArgs e)
 {
     if (SetupThePrinting())
     {
         MyPrintDocument.Print();
     }
     Close();
 }
Exemple #7
0
 private void BtnImprimir_Click(object sender, EventArgs e)
 {
     if (SetupThePrinting())
     {
         MyPrintDocument.Print();
     }
     //Close();
 }
Exemple #8
0
        private void PirintSet(object type)
        {
            try
            {
                string indexcolname = "";
                string custcolname  = "";
                foreach (DataGridViewColumn column in dataGridViewXs[superTabControl1.SelectedTab.Name].Columns)
                {
                    if (column.DataPropertyName.ToUpper() == "INDEXNO")
                    {
                        indexcolname = column.Name;
                    }
                    if (column.DataPropertyName.ToUpper() == "CUSTCODE")
                    {
                        custcolname = column.Name;
                    }
                }

                IEnumerable <DataGridViewRow> rows =
                    dataGridViewXs[superTabControl1.SelectedTab.Name].SelectedRows.Cast <DataGridViewRow>();
                DataGridViewRow[] Rows = rows.ToArray();

                if (superTabControl1.SelectedTab.Name == "superTabItem1")
                {
                    Array.Reverse(Rows); //对颠倒的行再次颠倒
                }

                List <string> indexnos = new List <string>();

                foreach (DataGridViewRow selectedRow in Rows)
                {
                    indexnos.Add(selectedRow.Cells[indexcolname].Value.ToString());
                }

                List <PrintInfo> psPrintInfos = new List <PrintInfo>();
                SendBoxList.GetSendBoxList(indexnos, ref psPrintInfos);

                foreach (PrintInfo PSInfo in psPrintInfos)
                {
                    printset.SetupThePrinting(MyPrintDocument, new SYSPrintsettings(), PSInfo);

                    if (Convert.ToInt32(type) == 1)
                    {
                        printPreviewDialog1.PrintPreviewControl.Zoom = 1.0;
                        this.printPreviewDialog1.ShowDialog();
                    }
                    else
                    {
                        MyPrintDocument.Print();
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        [Test, Explicit] //ExSkip
        public void CustomPrint()
        {
            Document doc = new Document(MyDir + "Rendering.doc");

            // Create an instance of our own PrintDocument.
            MyPrintDocument printDoc = new MyPrintDocument(doc);

            // Specify the page range to print.
            printDoc.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
            printDoc.PrinterSettings.FromPage   = 1;
            printDoc.PrinterSettings.ToPage     = 1;

            // Print our document.
            printDoc.Print();
        }
Exemple #10
0
        public void CustomPrint()
        {
            //ExStart
            //ExFor:PageInfo.GetDotNetPaperSize
            //ExFor:PageInfo.Landscape
            //ExSummary:Shows how to customize the printing of Aspose.Words documents.
            Document doc = new Document(MyDir + "Rendering.docx");

            MyPrintDocument printDoc = new MyPrintDocument(doc);

            printDoc.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
            printDoc.PrinterSettings.FromPage   = 1;
            printDoc.PrinterSettings.ToPage     = 1;

            printDoc.Print();
        }
Exemple #11
0
        public void CustomPrint()
        {
            //ExStart
            //ExFor:PageInfo.GetDotNetPaperSize
            //ExFor:PageInfo.Landscape
            //ExSummary:Shows how to implement your own .NET PrintDocument to completely customize printing of Aspose.Words documents.
            Document doc = new Document(MyDir + "Rendering.doc");

            // Create an instance of our own PrintDocument.
            MyPrintDocument printDoc = new MyPrintDocument(doc);

            // Specify the page range to print.
            printDoc.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
            printDoc.PrinterSettings.FromPage   = 1;
            printDoc.PrinterSettings.ToPage     = 1;

            // Print our document.
            printDoc.Print();
        }
Exemple #12
0
        public void StartPrint(Stream streamToPrint, string streamType)
        {
            this.MyPrintDocument.PrintPage += new PrintPageEventHandler(MyPrintDocument_PrintPage);

            this.streamToPrint = streamToPrint;

            this.streamType = streamType;

            System.Windows.Forms.PrintDialog PrintDialog1 = new PrintDialog();

            PrintDialog1.AllowSomePages = true;

            PrintDialog1.ShowHelp = true;

            PrintDialog1.Document = MyPrintDocument;

            DialogResult result = PrintDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                MyPrintDocument.Print();
            }
        }
Exemple #13
0
	static int Main ()
	{
		PreviewPrintController printController = new PreviewPrintController ();
		MyPrintDocument doc = new MyPrintDocument ();
		doc.PrintController = printController;
		doc.Print ();

		if (doc.Matrix.Elements.Length != 6)
			return 1;
		if (doc.Matrix.Elements [0] != 1)
			return 2;
		if (doc.Matrix.Elements [1] != 0)
			return 3;
		if (doc.Matrix.Elements [2] != 0)
			return 4;
		if (doc.Matrix.Elements [3] != 1)
			return 5;
		if (doc.Matrix.Elements [4] != 0)
			return 6;
		if (doc.Matrix.Elements [5] != 0)
			return 7;
		return 0;
	}
Exemple #14
0
        //菜单打印
        private void Print_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //PrintView_ToolStripMenuItem_Click(sender, e);

            DataGridView dgv = GetDataGridView();

            if (dgv != null)
            {
                PrintDialog MyPrintDialog = new PrintDialog();


                dgv.Refresh();

                if (MyPrintDialog.ShowDialog() == DialogResult.OK)
                {
                    MyPrintDocument.DefaultPageSettings = MyPrintDialog.PrinterSettings.DefaultPageSettings;

                    MyDataGridViewPrinter = new DataGridViewPrinter(dgv, MyPrintDocument, true, true, dgv.Name, new Font("SimSun", 18, FontStyle.Bold, GraphicsUnit.Point), Color.Black, true);

                    MyPrintDocument.Print();
                }
            }
        }
        public void CustomPrint()
        {
            Document doc = new Document(MyDir + "Rendering.doc");

            // Create an instance of our own PrintDocument.
            MyPrintDocument printDoc = new MyPrintDocument(doc);
            // Specify the page range to print.
            printDoc.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
            printDoc.PrinterSettings.FromPage = 1;
            printDoc.PrinterSettings.ToPage = 1;

            // Print our document.
            printDoc.Print();
        }
Exemple #16
0
        private LPTPrintSetup printset = new LPTPrintSetup(); //打印类
        private void PirintSet(object type)
        {
            try
            {
                string indexcolname = "";
                string custcolname  = "";
                foreach (DataGridViewColumn column in dgviewnone.Columns)
                {
                    if (column.DataPropertyName.ToUpper() == "INDEXNO")
                    {
                        indexcolname = column.Name;
                    }
                    if (column.DataPropertyName.ToUpper() == "CUSTCODE")
                    {
                        custcolname = column.Name;
                    }
                }

                IEnumerable <DataGridViewRow> rows =
                    dgviewnone.SelectedRows.Cast <DataGridViewRow>();
                DataGridViewRow[] Rows = rows.ToArray();
                Array.Reverse(Rows); //对颠倒的行再次颠倒


                foreach (DataGridViewRow selectedRow in Rows)
                {
                    string          indexcolvalue   = selectedRow.Cells[indexcolname].Value.ToString();
                    string          custvalue       = selectedRow.Cells[custcolname].Value.ToString();
                    SortingLineTask sortingLineTask = SortingLineTask.GetSortingLineByIndex(indexcolvalue);

                    //获取常规烟包
                    List <CigBoxInfo> cigBoxInfoList = CigBoxInfoList.GetBoxInfoByCustiomNo(sortingLineTask.CUSTCODE,
                                                                                            sortingLineTask.INDEXNO.ToString(), AppUtil._SortingLineId);

                    //获取异型烟包
                    int abnoboxcount = CigBoxInfoList.GetAbnoCigBoxNum(sortingLineTask.ORDERDATE,
                                                                       sortingLineTask.SORTINGTASKNO.ToString(), AppUtil._AbnoSortingLineId, sortingLineTask.CUSTCODE);


                    OutPort outPort = new OutPort(Convert.ToInt32(indexcolvalue));
                    outPort.GetCustSeq();

                    foreach (CigBoxInfo cigBoxInfo in cigBoxInfoList)
                    {
                        BusinessLogic.Print.PrintInfo PSInfo = new BusinessLogic.Print.PrintInfo();
                        PSInfo.CustomerName = sortingLineTask.ShortName;
                        PSInfo.CustomerCode = sortingLineTask.CUSTCODE;
                        PSInfo.IndexNo      = sortingLineTask.INDEXNO.ToString();
                        PSInfo.SortingDate  = "(" + sortingLineTask.ORDERDATE + ")";
                        PSInfo.BoxNo        = cigBoxInfo.BOXSEQ.ToString() + "/";
                        PSInfo.BoxCount     = cigBoxInfo.BOXCOUNT.ToString();
                        PSInfo.CurrentNum   = cigBoxInfo.BOXQTY.ToString() + "/" +
                                              sortingLineTask.SortingLineTaskDetails.GetTotQty().ToString();
                        //PSInfo.TaskNumber = sortingLineTask.SortingLineTaskDetails.GetTotQty().ToString();
                        PSInfo.DelivyLine  = sortingLineTask.LINENAME;
                        PSInfo.CustomerSqe = "(" + outPort["COUNTLINE"] + "/" + outPort["MAXCOUNTLINE"] + ")户";
                        //PSInfo.CustomerTotSeq = outPort["MAXCOUNTLINE"];
                        PSInfo.AbnoBoxCount = "异" + abnoboxcount;
                        PSInfo.Address      = cigBoxInfo.Address;
                        PSInfo.BoxIndex     = CigBoxInfoList.GetBoxIndex(PSInfo.IndexNo, cigBoxInfo.BOXSEQ.ToString(), AppUtil._SortingLineId);
                        printset.SetupThePrinting(MyPrintDocument, new SYSPrintsettings(), PSInfo);

                        if (Convert.ToInt32(type) == 1)
                        {
                            printPreviewDialog1.PrintPreviewControl.Zoom = 1.0;
                            this.printPreviewDialog1.ShowDialog();
                        }
                        else
                        {
                            MyPrintDocument.Print();
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }