All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
C#教程:单线程简介
SQL,Server,索引结构及其使用(三)_[SQL,Server教程]
使用C#来开发.NET,CF,蓝牙通信模块_.net资料_编程技术
C#教程:KeyDown与KeyUp事件使用实例
如何自动发布MS,SQL,SERVER数据库_[SQL,Server教程]
asp.net2.0内置Application对象的方法
SQL,Server存储过程编写和优化经验_[SQL,Server教程]
Sql,server加密技术和SQL注入攻击_[SQL,Server教程]
在ASP.NET中上传图片并生成缩略图_[Asp.Net教程]
delphi图像格式处理
Reading number is top 10 pictures
Azusa Yamamoto2
恶搞漫画2
Park waits to have her picture taken exposed
真正的国产-非模拍 贵在是真实1
A man's favorite things10
The hot big eye big breast beauty3
这玉米,买还是不卖?
人造器官和铁肺人
这才是真正的人体艺术2
50个至今影响世界的德国发明
Download software ranking
Boxer's Top ten classic battle10
Call Of Duty2
Unix video tutorial9
WebService在.NET中的实战应用教学视频 → 第1集
Tram sex maniac 2 (H) rar bag16
Twenty piece of palm leaf
matrix3
WebService在.NET中的实战应用教学视频 → 第3集
Kung fu panda - the secret of the teacher
Sora aoi - one of more PK
delv published in(发表于) 2014/1/6 8:49:04 Edit(编辑)
asp.net,水晶报表

asp.net,水晶报表

asp.net 水晶报表-主从表关联问题_[Asp.Net教程]

一、使用视图meeting将多表关联整合在一起


二、通过Sql语句筛选数据


三、建立和主从表的关联


四、注意在CrystalReport1表中插入子报表的时候,一定要将主从表的关联字段设置好,否则出乱子


主体代码如下:


///


/// Bind CrystalReport
///

/// sql
private void bdReport(string strS)
{
oCR = new CrystalReport1();
SqlConnection cnn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionSqlServer"]);


SqlDataAdapter cmd1 = new SqlDataAdapter(strS,cnn);


//Create and fill the DataSet.


DataSet2 ds = new DataSet2();
cmd1.Fill(ds,"meeting");


// SqlDataAdapter cmd2 = new SqlDataAdapter("select * from realplan where rplanid in (select top 10000 planid from ("+sqlStr+")as a order by planid)", cnn);
SqlDataAdapter cmd2 = new SqlDataAdapter(SqlIsOper, cnn);

cmd2.Fill(ds,"realplan");


//Create the relation between the Authors and Titles tables.
ds.Relations.Add("mo",
ds.Tables["meeting"].Columns["planid"],
ds.Tables["realplan"].Columns["rplanid"]);


//binding reportViewer
oCR.SetDataSource(ds);


this.CrystalReportViewer1.ReportSource = oCR;


//Close the connection.
cnn.Close();

}


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.