http://www.telerik.com/help/reporting/mvc-report-viewer-extension-embedding.html
我正在使用带有ASP.NET MVC的telerik报告并尝试访问会话变量,但它总是返回null。会话在除以下方法之外的任何其他地方都能完美运行
private void Report4_ItemDataBound(object sender, EventArgs e)
{
ReportViewModel model = (ReportViewModel)System.Web.HttpContext.Current.Session["ReqColumns"]; // session is null here
}
private void Report4_NeedDataSource(object sender, EventArgs e)
{
ReportViewModel model = (ReportViewModel)System.Web.HttpContext.Current.Session["ReqColumns"]; // session is null here
}
答案 0 :(得分:0)
试试这个可能有帮助...
// Use parameter
private void HDMF_NeedDataSource(object sender, EventArgs e)
{
string group= string.Empty;
string sortBy = string.Empty;
Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;
var payoutUID = report.Parameters["payoutUID"].Value.ToString();
// some code here...
}