从Report Viewer导出RDLC报表为PDF时页面重复问题求助
单页RDLC报表导出PDF时页面重复问题
我制作了一份单页RDLC报表,在Report Viewer中预览时显示为正常单页状态(截图:
),但将报表保存为PDF格式时,页面会出现重复内容(截图:
)。我尝试过修改页面尺寸、移除所有变量等操作,都没能解决问题。
以下是生成报表的C#代码:
using Microsoft.Reporting.WinForms; using System.Data; using System.Data.SqlClient; namespace MediniApp { public partial class Form1 : Form { public Form1() { InitializeComponent(); } SqlConnection con = new SqlConnection(@";"); private void button1_Click(object sender, EventArgs e) { con.Open(); SqlCommand command = new SqlCommand("select * from Owner",con); SqlDataAdapter adapter = new SqlDataAdapter(command); DataTable dt = new DataTable(); adapter.Fill(dt); reportViewer1.LocalReport.DataSources.Clear(); ReportDataSource source = new ReportDataSource("Owner",dt); reportViewer1.LocalReport.ReportPath = @"C:\Report1.rdlc"; reportViewer1.LocalReport.DataSources.Add(source); reportViewer1.RefreshReport(); } private void Form1_Load(object sender, EventArgs e) { } } }
内容的提问来源于stack exchange,提问作者Anish Koundinya
相关产品推荐
相关产品推荐

