Pass TextBox value to Crystal Report in C#
This article explains how to pass a TextBox value to Crystal Report Text Object.
First, add a TextBox and a Button in the first Windows Form, and in the second add a
CrystalReportViewer and add a Text Object in the Crystal Report. Then in Button click event
add this code:
For more details watch this video
First, add a TextBox and a Button in the first Windows Form, and in the second add a
CrystalReportViewer and add a Text Object in the Crystal Report. Then in Button click event
add this code:
private void button1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
CrystalReport1 cr = new CrystalReport1();
TextObject text = (TextObject)cr.ReportDefinition.Sections["Section3"].ReportObjects["Text1"];
text.Text = textBox1.Text;
f2.crystalReportViewer1.ReportSource = cr;
f2.Show();
}
For more details watch this video
Pass TextBox value to Crystal Report in C#
Reviewed by Bloggeur DZ
on
03:48
Rating:
how about the textboxes and crys. report at same form?
RépondreSupprimerI follow what you did on video but still dont put the value to crystal report.no error .but not showing the text
RépondreSupprimerme too
Supprimerf2.crystalReportViewer1.ReportSource = cr; still error this how to fix it
RépondreSupprimeruse CrystalReporViwer1.ReportSource = name your crystal report ;
RépondreSupprimerCrystalReportViewr1.Refresh();
f2.crystalReportViewer1.ReportSource = cr; still error this how to fix it
RépondreSupprimershould make private to public to crystalreportviewer1.....go to property of crystalreportvieweer1 and then click on modifiers to make a public
RépondreSupprimer