将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();
}