VS2008 用Crystal Report做报表不能翻第3页,只能直接输入页码再点"转到",Why?我的步骤:1. 做一个新Crystal Report报表,在报表设计里直接连接数据库并写SQL完成报表。
2. 做一个Web页面,有个查询条件,添加CrystalReportViewer1, 写了个方法如下:
private bool MyRptDataBind()
{
string vSql;
vSql = "select * from table where .... "+页面上的条件
DataTable dt = da.GetDataTable(vSql);
if (dt != null)
{
ReportDocument rd = new ReportDocument();
string s = BR.GetReportsPath() + "SaleRptWeeklyStat.rpt";
rd.Load(s);
rd.SetDataSource(dt);
CrystalReportViewer1.ReportSource = rd;
CrystalReportViewer1.DataBind();
}
return truel;
}
3. 在CrystalReportViewer1的Load事件中调用,如下:
protected void CrystalReportViewer1_Load(object sender, EventArgs e)
{
if (!MyRptDataBind())
{
}
}不能为什么,能正常显示报表,选择条件也正常,就是翻到第3页不行? 为什么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货