我用C#开发ASP.NET的WEB程序,我想在我的程序中实现打印预览,有什么好的解决办法? 水晶报表可以实现吗?回答任意相关者,都有分。

解决方案 »

  1.   

    有一段程序给你:<OBJECT   id=WebBrowser   classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2   height=0   width=0></OBJECT>   //这个可能没用
      <input   type=button   value=打印           onclick=document.all.WebBrowser.ExecWB(6,1)>   
      <input   type=button   value=直接打印   onclick=document.all.WebBrowser.ExecWB(6,6)>   
      <input   type=button   value=页面设置   onclick=document.all.WebBrowser.ExecWB(8,1)>   
      <input   type=button   value="打印OK"   onclick="   return   myprint(this);">                         
      <input   type=button   value=打印预览   onclick=document.all.WebBrowser.ExecWB(7,1)> 
      

  2.   

    如果我想用VS 2005里面自带的水晶报表,可以实现打印预览吗?回答:可以  从工具栏拖个CrystalReportViewer控件给你一段代码
    ViewReport Rpt=new ViewReport();//创建一个rpt文件
    Rpt.SetDataSource(ds);  //将ds(dataset对象)付给rpt
    CrystalReportViewer1.ReportSource=Rpt;//绑定
    CrystalReportViewer1.ShowFirstPage();//显示首页面
      

  3.   

    ViewReport Rpt=new ViewReport();//创建一个rpt文件ViewReport 提示缺少引用,这个要引用哪个名字空间啊? 谢谢