如何將任何文本值從窗體傳遞給Crystal Report?如何將任何文本值從表單傳遞到Crystal Report?
例如:我需要將Form1中的「hellow」傳遞給我的Crystal Report,該怎麼做?
(工作在C#)
感謝的提前
如何將任何文本值從窗體傳遞給Crystal Report?如何將任何文本值從表單傳遞到Crystal Report?
例如:我需要將Form1中的「hellow」傳遞給我的Crystal Report,該怎麼做?
(工作在C#)
感謝的提前
在Crystal創建參數字段。您可以在運行時通過參數集合來設置它的值。
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
}
感謝的您的幫助,我可以得到更多的細節的? 我不知道該怎麼做 – Gold 2009-10-22 05:57:14
您可以在Field Explorer中在Crystal中創建參數;右鍵單擊參數字段,然後選擇新建。 Crystal文檔可以爲您提供有關創建參數的更多信息。 這應該有助於您開始使用C#部分:http://msdn.microsoft.com/en-us/library/aa289936(VS.71).aspx – 2009-10-24 13:22:06