You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

从Report Viewer导出RDLC报表为PDF时页面重复问题求助

单页RDLC报表导出PDF时页面重复问题

我制作了一份单页RDLC报表,在Report Viewer中预览时显示为正常单页状态(截图:Report Viewer单页显示),但将报表保存为PDF格式时,页面会出现重复内容(截图: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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 15:53:10