C# 由于保护级别,报表查看器无法访问

C# 由于保护级别,报表查看器无法访问,c#,visual-studio-2012,crystal-reports,C#,Visual Studio 2012,Crystal Reports,将文本框值传递到Crystal Report时出现此错误。我如何解决这个问题 错误1“Project.Print1.crystalReportViewer1”无法访问,因为其保护级别为C:\Users\Yourlaks\Desktop\U1\Project\Project\Callcul.cs 307 16 Project 此代码从我的文本框中获取要在报告中显示的值,包括错误行: private void buttonX3_Click(object sender, EventArgs e) {

将文本框值传递到Crystal Report时出现此错误。我如何解决这个问题

错误1“Project.Print1.crystalReportViewer1”无法访问,因为其保护级别为C:\Users\Yourlaks\Desktop\U1\Project\Project\Callcul.cs 307 16 Project

此代码从我的文本框中获取要在报告中显示的值,包括错误行:

private void buttonX3_Click(object sender, EventArgs e)
{
    Print1 pr = new Print1();
    CrystalReport1 cr1 = new CrystalReport1();
    TextObject to1 = (TextObject)cr1.ReportDefinition.Sections["Section4"].ReportObjects["Txt1"];
    to1.Text = textBoxX1.Text;
    pr.crystalReportViewer1.ReportSource = cr1;
    pr.Show();
}