按照网上搜的资料,利用了.net自带的World Sales Report.rpt,用一下Cystal Reports,我用的C#
过程是这样的:
先引入CrystalReportViewer控件,在属性中写入自定义绑定:E:\\Microsoft Visual Studio .NET 2003\\Crystal Reports\\Samples\Reports\\General Business\\World Sales Report.rpt,然后再.aspx上加载成功,在.aspx.cs上生成代码两行:
<%@ Register TagPrefix="cr" Namespace="CrystalDecisions.Web" Assembly="CrystalDecisions.Web, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" %>
。。
form里
<cr:CrystalReportViewer id="CrystalReportViewer1" runat="server"  ReportSource='<%# "E:\Microsoft Visual Studio .NET 2003\Crystal Reports\Samples\Reports\General Business\World Sales Report.rpt" %>' Height="977px" Width="966px">
</cr:CrystalReportViewer>
在page_load里写入
CrystalReportViewer1.DataBind()可是debug是出现编译错误:
总提示
<cr:CrystalReportViewer id="CrystalReportViewer1" runat="server"  ReportSource='<%# "E:\Microsoft Visual Studio .NET 2003\Crystal Reports\Samples\Reports\General Business\World Sales Report.rpt" %>' Height="977px" Width="966px">
</cr:CrystalReportViewer>
这行有错误,搞不明白。这里面我也没改什么呀。都是自动生成的。难道还必须连数据库么?
上网查理一些资料还是没解决,只能求助大家了。
用过的朋友帮忙了,小弟谢谢了!!