//取得数据集
string connstring = "Data Source=127.0.0.1;Initial Catalog=abn_LTGS;User ID=sa;Password=;Persist Security Info=True;MultipleActiveResultSets=False;Packet Size=4096";
System.Data.SqlClient.SqlConnection conn1 = new System.Data.SqlClient.SqlConnection(connstring);
System.Data.SqlClient.SqlCommand command1 = new System.Data.SqlClient.SqlCommand("select lane from deviantList", conn1);
System.Data.SqlClient.SqlDataAdapter ada1 = new System.Data.SqlClient.SqlDataAdapter(command1);
DataSet c_ds = new DataSet();
try
{
conn1.Open();
ada1.Fill(c_ds);
}
finally
{
conn1.Close();
command1.Dispose();
conn1.Dispose();
}
//为报表浏览器指定报表文件
this.reportViewer1.LocalReport.ReportPath = @"d:\documents\visual studio 2010\Projects\报表1\报表1\Report1.rdlc";
this.reportViewer1.LocalReport.DataSources.Clear();
this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", c_ds.Tables[0]));
this.reportViewer1.RefreshReport();
加载数据正常!
这里设置边距和A4纸
图片说明
rdlc XML
http://ask.csdn.net/questions?type=reward#
导出EXCEL后边距却没有改变
请赐教!!