由于保护级别,报告查看器无法访问

时间:2016-11-03 10:36:40

标签: c# visual-studio-2012 crystal-reports

将TextBox值传递给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();
}

0 个答案:

没有答案