<script type="text/javascript">
        function PrintGridView() {
            // 打开一个新网页
            var newwindow = window.open('printer','','');            // 将指定DIV中的内容写入该网页
            newwindow.document.write(document.getElementById('dvBody').innerHTML);
            newwindow.document.close();            // 打印该网页
            newwindow.focus();
            newwindow.print();            // 打印完毕后关闭该窗口
            newwindow.close();
            return;
        }
  </script>上面这段代码是  打印gridview中的数据
现在想改改这段代码!
   gridview中有17列字段,直接打印的话纸张不够  必须的横着打印了  
    想要指定打印哪几列   这个问麻烦不麻烦?  
  我现在还没思路!
 要是麻烦的话 我想直接给它来个横向打印得了!

解决方案 »

  1.   

    指定列的话你需要写js代码,选择列,然后设置样式其他列隐藏。
    也不是很麻烦。横向打印需要客户自己选择,默认情况下,程序不能设置。activex可以设置,但兼容性是问题
      

  2.   

    本帖最后由 net_lover 于 2011-09-09 14:57:40 编辑
      

  3.   

    横向打印,使用插件的实现方法factory.printing.portrait = true 
    factory.printing.portrait = false
    控件的使用和下载介绍
    http://xiaofengtoo.iteye.com/blog/778863
      

  4.   

    要想做好的打印的话你可以使用lodop控件,你可以通过相关的东西指定需要打印内容