如何将任何文本值从表单传递到Crystal Report?

时间:2009-10-21 20:43:09

标签: c# crystal-reports

如何将任何文本值从表单传递到Crystal Report?

例如:我需要将“hellow”从Form1传递到我的Crystal Report,该怎么做?

(在C#中工作)

提前谢谢

4 个答案:

答案 0 :(得分:4)

在Crystal中创建一个参数字段。您可以在运行时通过参数集合设置其值。

答案 1 :(得分:2)

CrystReport1 plc = new CrystReport1();
plc.DataDefinition.FormulaFields["Formula Fild Name*"].Text = "" + textBox1.Text + "";

答案 2 :(得分:1)

CrystReport1 plc = new CrystReport1();
plc.DataDefinition.FormulaFields["Formula Fild Name*"].Text = " '" + textBox1.Text + "'";

答案 3 :(得分:0)

     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
}