水晶报表自定义纸张大小打印 (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(
1true00);
posted @ 2007-11-29 11:06  Ready!  阅读(4175)  评论(5编辑  收藏  举报