点击一个按钮打印水晶报表里面的东西水晶报表里面的那个打印按钮能打印`我想放另外一个button 然后点击进行打印` 怎么实现呢?谢谢了

解决方案 »

  1.   

    PrintReport(),水晶报表有自己的toolbar可以打印,干嘛还要自己写?
      

  2.   

    PrintReport(),没有这个方法啊在哪里呢  我要通过一个按钮打印~因为项目的需要所以要找这个方法`
      

  3.   

    [WinForm pull模式 SQL2000]
            private void btn款式资料_Click(object sender, EventArgs e)
            {
                ReportDocument aReportDocument = new ReportDocument();
                aReportDocument.Load(@"E:\Crystal\款式资料.rpt");
                foreach (Table aTable in aReportDocument.Database.Tables)
                {
                    aTable.LogOnInfo.ConnectionInfo.ServerName = "";
                    aTable.LogOnInfo.ConnectionInfo.DatabaseName = "";
                    aTable.LogOnInfo.ConnectionInfo.UserID = "";
                    aTable.LogOnInfo.ConnectionInfo.Password = "";
                    aTable.ApplyLogOnInfo(aTable.LogOnInfo);
                }
                View.SelectionFormula = "{表.ID}  =  'A001' ";
                View.ReportSource = aReportDocument;
            }
      

  4.   

    這位仁兄說的意思是,自己写个方法,名称叫PrintReport(),楼主是当然找不到啦,呵呵!
      

  5.   

    Me.CrystalReportViewer1.PrintReport()
    就是这个东东
      

  6.   

    我刚才试了一下也没找到PrintReport()方法
      

  7.   

    private ReportDocument myReport = new ReportDocument();然后你button的事件里面是
    myReport.PrintToPrinter(打印的份数,true,第几页开始打,打到第几页)当然在此之前  你要自己设置打印的 报表名称,报表路径,报表源 哦
      

  8.   

       private ReportDocument RDC = new ReportDocument();   string rpt_path = RegeditControler.ROOT_PATH + "\\RPT\\cartest_line_result_rpt.rpt";
       DS_CAR_RECORD_RESULT RPT_DT;//水晶报表用到的dataset
                  
       RDC.Load(rpt_path);                
        RPT_DT = cartest_rpt_controler.GET_CAR_RECORD_DATA(PID, TEST_TIME);                
                    
         RDC.SetDataSource(RPT_DT);
         crtbox.ReportSource = RDC;
         crtbox.RefreshReport();     RDC.PrintToPrinter(1, false, 0, 0); //自动打印