如何将任何文本值从表单传递到Crystal Report?
例如:我需要将“hellow”从Form1传递到我的Crystal Report,该怎么做?
(在C#中工作)
提前谢谢
答案 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
}