RDLC报表开发技巧备忘
时间:2011-02-18 来源:冀中
1.PageHeader区域不能放Table、List控件,如果需要显示动态信息,那么可以通过引用Body中的控件值来显示,但是注意,Body控件只能在某一页显示,翻到其他页码时,控件值会为空。
2.引用外部图片时,可以用代码添加图片。方法为在Image控件的Value上添加外部引用:=file:///+...,并且要将EnableExternalImages属性设置为true。
3.Table控件的Filter表达式很奇怪,如果DataSet表中的字段属性为Int,Filter表达式会经常报错,最偷懒的方法是将DataSet表中的字段属性修改为String类型,这样一来天下太平。
4.显示页码代码为:="Page "+Globals.PageNumber.ToString() & " of " & Globals.TotalPages.ToString()。
5.导出的PDF中,汉字显示为乱码,往往是字体设置问题,将字体设置为汉字字体,问题即可解决。
6.报表参数可以这样用:
ReportParameter rp1 = new ReportParameter("Notes", “abc");
this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1});
7.打印时出现空白页,是由于Body的宽度>PageWidth - MarginLeft - MarginRight造成的,只要减小Body宽度小于PageWidth-...,即可。

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载- 4 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载73.78MB · 96℃
1970-01-01
- 5 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载43.7 MB · 99℃
1970-01-01
- 6 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载110.69MB · 98℃
1970-01-01