2
votes

http://www.telerik.com/help/reporting/mvc-report-viewer-extension-embedding.html

I'm using telerik reports with ASP.NET MVC and trying to access a session variable, but it's always return null. session works perfectly in any other place except for below methods

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

        }
1

1 Answers

0
votes

Try this if could help...

// 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...
}