水晶报表自定义纸张大小打印 (Crystal Report Print with custom paper size)

  System.Drawing.Printing.PrintDocument doc = new PrintDocument();
            doc.PrinterSettings.PrinterName = "NFCP LQ1600K";
            int rawKind = 1;
            for (int i = 0; i <= doc.PrinterSettings.PaperSizes.Count - 1; i++ )
            {
                if (doc.PrinterSettings.PaperSizes[i].PaperName == "Test1")
                {
                    rawKind = doc.PrinterSettings.PaperSizes[i].RawKind;
                }
            }

            WindowsApplication1.CrystalReport5 rpt = new CrystalReport5();
            ReportDocument rptDoc = (ReportDocument)rpt;
            rptDoc.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)rawKind;
            rptDoc.PrintToPrinter(1, true, 0, 0);

 

posted on 2013-09-06 21:03  武胜-阿伟  阅读(4670)  评论(1编辑  收藏  举报