Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Urgent: I need to pass a variable to a stored proc Post Reply Post New Topic
Author Message
aruplabs
Newbie
Newbie


Joined: 31 Dec 2007
Location: United States
Online Status: Offline
Posts: 1
Quote aruplabs Replybullet Topic: Urgent: I need to pass a variable to a stored proc
    Posted: 31 Dec 2007 at 8:30am

I work for a health care provider and I have reports that pull PHI (Protected Health Information) about patients that needs to be logged according to federal HIPAA regulations. One of the pieces of information that needs to be logged is the username of the person who ran the report. Since these reports will be run from our Crystal Enterprise server I can get this from the CurrentCEUserName variable but I am looking for a way to pass this value to a stored procedure that will not only return the records for the report, but also log the disclosure in our PHI disclosure tracking table. I know you can pass a parameter to a stored procedure but I dont know how, or if it is even possible, to pass a run time variable. This is an urgent problem that I need to find a solution for. Any help would be appreciated.

 Thank you.

Martin Miller
IT Database Analyst
ARUP Laboratories
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 31 Dec 2007 at 4:12pm
Hilfy is the resident Crystal Enterprise expert on the forum and she has already done similar things. Search the forum for her posts and you'll find something similar that I remember being posted months back. Here is some generic info that might help.

Yes, you can pass a parameter to a stored procedure. Simply create the stored procedure with the necessary Input parameter and then create a new report using that stored procedure as the data source. CR will create a parameter in the report that will pass the data to it. The problem is that you need to populate the parameter with the user name prior to running the report. Otherwise, the user will be prompted to enter their user name prior to running the report (this might be ok, but most likely an irritant to the user). If you are using CR.NET, then you can do this programatically using the object model. Most likely, you are just using plain CR XI. Another option is to make the report a subreport of a blank main report. In the main report, use a formula to get the user name and then link that formula to the subreport's user name parameter. When the subreport runs, the parameter will have the correct user name in it and pass this to the SP.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.