How to pass any text value from form to Crystal Report?
How to pass any text value from form to Crystal Report ?
ex: i need to pass "hellow" from Form开发者_如何学运维1 to my Crystal Report , how to do it ?
(working in C#)
thank's in advance
Create a parameter field in Crystal. You can set its value via the parameters collection at run-time.
CrystReport1 plc = new CrystReport1();
plc.DataDefinition.FormulaFields["Formula Fild Name*"].Text = "" + textBox1.Text + "";
CrystReport1 plc = new CrystReport1();
plc.DataDefinition.FormulaFields["Formula Fild Name*"].Text = " '" + textBox1.Text + "'";
ReportDocument dailyIssueDocument=new ReportDocument();
var fD = dailyIssueDocument.ReportDefinition.ReportObjects["fTextBox"] as TextObject;// fTextBox is a Text object that i take to my report for showing form select date
if (fD != null){
fD.Text = fDate;//This is Date field that comes from form text box
}
精彩评论