2014-12-31 65 views
0

我必須發起fastreport報告並將其填充到新頁面。沒問題!報告正確顯示。
但後來我在FastReport設計器中聲明瞭一個參數,名爲「CurrentDateTimeParam」。該參數旨在顯示報告的當前日期和時間。FastReport mvc GetParameter()返回null

注意:這個DateTime不是一個正常的DateTime(實際上是Persian DateTime)。所以它必須通過代碼進行估計。

所以我決定在控制器
來設置它的值由webReport.Report.SetParameterValue("CurrentDateTimeParam","Some String Here")

增益,報告顯示正確,除了日期時間沒有更新。也

webReport.Report.GetParameter("CurrentDateTimeParam") 

返回NULL。任何建議?

回答

1

這可能看起來很愚蠢,但我最終通過在某些事件觸發器中放置上述代碼行來解決問題。如下所示:

webReport.Report.StartReport += delegate(object sender, EventArgs e) 
{ 
    webReport.Report.SetParameterValue("CurrentDateTimeParam","Some String Here"); 
}