zoukankan      html  css  js  c++  java
  • 在web水晶报表的使用

    首先    
    需要在.aspx.cs文件中引入:using CrystalDecisions.CrystalReports.Engine;
    创建.xsd文件和.rpt文件,.xsd文件其实是在.aspx.cs中创建的DataSet中的字段的映射。(可以添加,修改)。
    然后
    在.aspx.cs文件中操作,
    ReportDocument oCR =null;
    DataSet ds = data.GetDataSet();
    oCR = new R_StandardAuditPrint();
    oCR.SetDataSource(ds);
    crvMainView.ReportSource=oCR;  //CrystalDecisions.Web.CrystalReportViewer crvMainView 报表浏览器
     
    其次
    需要注意是,在 .aspx文将中,设置CRYSTALREPORTVIEWER的一些属性,
     <TABLE id="Tab4le1" height="100%" cellSpacing="2" cellPadding="2" width="100%">
     <tr>
      <td vAlign="top" id="m_printpage"><FONT face="宋体"><CR:CRYSTALREPORTVIEWER id="crvMainView" runat="server"    Width="350px" EnableDrillDown="False" DisplayToolbar="False" DisplayGroupTree="False"    Height="50px"></CR:CRYSTALREPORTVIEWER></FONT>
      </td>
     </tr>
    </TABLE>
    最后
    在.aspx的btnprint.onclick事件中调用(javascript)
    function printpage(m_printpage)
    {
        var newstr = document.all.item(m_printpage).innerHTML;
        var oldstr = document.body.innerHTML;     
        document.body.innerHTML = newstr; window.print();
        document.body.innerHTML = oldstr;
        return true;
    }
    完成打印!
  • 相关阅读:
    全面了解Cookie
    HTML5实现无刷新修改URL
    闭包的理解
    JS中的prototype、__proto__与constructor
    Array.prototype.slice.call()方法详解
    深入理解 Array.prototype.map()
    网页布局——Flex弹性框布局
    vue项目的各个文件作用
    node使用心得
    node连接Mysql报错ER_NOT_SUPPORTED_AUTH_MODE
  • 原文地址:https://www.cnblogs.com/aipeli/p/262612.html
Copyright © 2011-2022 走看看