This is a migrated thread and some comments may be shown as answers.

Using Session variables in reports

1 Answer 261 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 29 Dec 2011, 08:44 PM
Team,

I have a fairly complicated report that uses 2 report parameters to generate the data for the report.

I would like to be able to assign the values of these parameters from session variables when I load the page with the report.

I've tried the several suggestion on the forum, but none of those seem to work. 
I would like to assign the parameters in the page_load 

I am using vb if that makes any difference.

Thanks in advance for your help!

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 03 Jan 2012, 03:13 PM
Hi,

In the following example you can see how to access a session variable and pass it as value for the report parameter:


report1.ReportParameters("MyReportParameter").Value = System.Web.HttpContext.Current.Session("MySessionVariable")

Let us know whether the proposed solution helps.

Regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Dave
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or