高分求解,WINFORM水晶报表问题

flers 2004-03-15 03:02:56
private void frm_bjd_Load(object sender, System.EventArgs e)
{
strconn myconn=new strconn();
SqlConnection sqlconn=new SqlConnection("data source=FLERS;initial catalog=xtdatabaset;persist security info=False;user id=sa;workstation id=FLERS;packet size=4096");
myconn.sqlconn.Open();
SqlDataAdapter myadapter;
xtbjd bjdrpt=new xtbjd();
sqlconn.Open();
myadapter=new SqlDataAdapter("select * from products where id<20",sqlconn);
DataSet rptds=new DataSet();
myadapter.Fill(rptds);
bjdrpt.SetDataSource(rptds.Tables[0].DefaultView);
this.crystalReportViewer1.ReportSource=bjdrpt;
sqlconn.Close();
}
private void frm_bjd_SizeChanged(object sender, System.EventArgs e)
{
this.crystalReportViewer1.Width=this.Width;
this.crystalReportViewer1.Height=this.Height;
}
问题:我select * from products where id<20没作用?一打开FORM时把整张表的内容分成123页,数据全部显示出来了,并不能执行达到我所要的结果呢?试了N次,重做了N次.RPT文件,用的是WIN2003+VS.net2003+自带的水晶报表。
...全文
44 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
flers 2004-05-07
  • 打赏
  • 举报
回复
谢谢个位了,用eTopFancy(你的美丽我的回忆) 方法OK,
有空请看http://expert.csdn.net/Expert/topic/3035/3035435.xml?temp=.2931482
zhpsam109 2004-03-22
  • 打赏
  • 举报
回复
select * from products where id<20
这个单独拿出来执行呢?
saucer 2004-03-22
  • 打赏
  • 举报
回复
are you sure? check the size of the dataset?

myadapter.Fill(rptds);
int n = rptds.Tables[0].Rows.Count;
eTopFancy 2004-03-22
  • 打赏
  • 举报
回复
rptds重新填充数据的时候清空以下
flers 2004-03-16
  • 打赏
  • 举报
回复
有没有人相助一把,150分相送!
http://expert.csdn.net/Expert/topic/2781/2781641.xml?temp=.0388605

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧