1.使得reportviewer 自动可以调节大小
AsyncRendering="False" 确定是否从网页的其余部分异步呈现该报表
SizeToReportContent="True" 确定报表区域是具有固定大小还是等于报表内容的大小
ZoomMode="FullPage" 确定应用于报表的缩放类型
2.reportviewer 不设置分页
通过设置“report”的属性interactivesize 的height的值为0In 就可以,不再分页,正页显示全篇
3。建立一个subreport
a.添加一个subreport控件,设置其连接的子报表和参数方法

b.子报表端设置参数的方法

c.web页面段如何加载报表和子报表
public ReportSet rs = null;
protected void Page_Load(object sender, EventArgs e)
{
rs = Context.Application["SubjectReportData"] as ReportSet;
ReportViewer1.LocalReport.EnableExternalImages = true;---加外部图片的必须设置的。
ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubReportProcessingEventHandler);
-------加载子报表进程。
ReportViewer1.LocalReport.DataSources.Add(
new Microsoft.Reporting.WebForms.ReportDataSource("DtSubject",
rs.DtSubject));-----加数据源、
DataRow dr = rs.DtEstablishmentList.NewRow();
dr["establishment_id"] = "1";
dr["contactId"] = Int32.Parse(rs.DtSubject.Rows[0]["contact_id"].ToString());
dr["establishment_name"] = "a";
rs.DtEstablishmentList.Rows.Add(dr);
string staffName=Session["staff_name"]==null?"userName":Session["staff_name"] as string;
Microsoft.Reporting.WebForms.ReportParameter[] mrps = new Microsoft.Reporting.WebForms.ReportParameter[1];
mrps[0]= new Microsoft.Reporting.WebForms.ReportParameter("staffName", staffName);
ReportViewer1.LocalReport.SetParameters(mrps);---加外部参数
this.ReportViewer1.LocalReport.Refresh();
}
private void SubReportProcessingEventHandler(object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
{
e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DtPhoneList", rs.DtPhoneList));
e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DtAddressList", rs.DtAddressList));
e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DtSubjectList", rs.DtSubjectList));
e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DtVehicleList", rs.DtVehicleList));
e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DtImagesList", rs.DtImagesList));
e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DtEstablishmentList", rs.DtEstablishmentList));
-----加载子报表数据源 。
}
注意: 子报表的数据源为空值的时候,子报表会自动不显示任何的内容(即时它里面还和数据源无关的内容,照样不显示),但是当只显示子报表作为主报表显示时,就可以显出来。
5.如何加一个Image
image分为三种可以通过的source 属性分为三种,External(外部图片),Embedded(嵌入式图片),Database(数据库中的图片)
加入一个External(外部图片)
步骤一。 protected void Page_Load(object sender, EventArgs e)
{
rs = Context.Application["SubjectReportData"] as ReportSet;
ReportViewer1.LocalReport.EnableExternalImages = true;---加外部图片的必须设置的。} web page页面中设置个属性
步骤二 ,image 的属性,source的值为External(外部图片),MIMEType的值为image/jpeg,value的值(图片的路径,它必须是一个实际路径,不能是相对路径)file:D:/1。jpg 或是=Fields!ImageUlr.Value(它表示一个本站点上的pic路径),这个值不能是"d:/”&Fields!ImageUlr.Value 这样的。
6.rdlc 中的控件 table的数据筛选方法
单击右键,属性的筛选项
,设置筛选条件,从而达到筛选的目的
7.list的数据的筛选,实际只是让list的部分数据隐藏,不显示
=Fields!contactId.Value<>Parameters!contactId.Value (条件不相等的时候就隐藏)
8.显示页码的函数="Page " & Globals!PageNumber & " of "&Globals!TotalPages
9。显示现在时间的函数=Now()
10。table 和list 都可以实现这样的效果 
11.=iif(Fields!ImageUlr.Value<>"",Fields!ImageUlr.Value,"file:D:\Establishment.JPG") 这个函数的意思Fields!ImageUlr.Value<>"",为条件,条件为真时Fields!ImageUlr,条件为假是结果为 ,"file:D:\Establishment.JPG")
浙公网安备 33010602011771号