|
|
web下水晶报表的使用! |
|
|
作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站 |
在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; } 完成打印! | | | |

|
|
相关文章:相关软件: |
|