Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET Session Variable used as parameter to report

Status
Not open for further replies.

kaijanm

Programmer
May 14, 2003
102
US
Hello, I'm a complete newbie to Crystal Reports and I'm using the version that comes with VS.Net.

I (kind of) created a report that is based on a sproc on the SQL Server. The SPROC requires the customer ID to be passed to it. I have it stored in a Session Variable in my application.

How do I take the session variable and pass it as a parameter through the report?

Thank in Advance!
Kimberly
 
Hi,
I am using the following code to retrieve a session variable, but be aware that I am pushing down the query to the database server so that the CR doesn't retrieve ALL the records in the database. In fact, I have a form that lets the user select the criteria, then I call the ASPX form that contains the report viewer. This code lives inside the PageLoad event:

'Retrieve parameter value entered in web form called....
' testCountySelectRegion.aspx
' the session variable is "CTARegion"
Dim strRegion As String
strRegion = Session("CTARegion".ToString)


I wrote an FAQ on the topic of passing criteria from a separate form to the ASPX form that contains the report viewer. You can find it at: faq766-5471


HTH, [pc2]
Randy Smith, MCP
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top