Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: session variables Post Reply Post New Topic
Author Message
sa-user
Groupie
Groupie


Joined: 29 Jun 2011
Online Status: Offline
Posts: 65
Quote sa-user Replybullet Topic: session variables
     Posted: 11 Jul 2011 at 12:31pm
Hi ,
We have crystal report integrated with out application. When a user logs in and views a report we need the application security applied to the resulting data. I believe this could be accomplished via session variables.
 
 
Does anyone have an example to build a crystal report to use session varialbes?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Jul 2011 at 4:10am
while I don't web program, in the console world (which is probably the same as the web world) CR doesn't know or care or implement security. If you access it, you must have the ability to see report.
 
How can you get around this?  Have your parameters selected by the user in your web page (here you can apply security as to what they can see), pass them to a stored proc (again, you can pass the session variables as well and have the stored proc apply any security as needed as well) and set the dataset/datatable returned from the stored proc as the datasource of the report.  As long as the data is in the format desired, CR will use it (ie you don't need to connect CR to a database if you don't want to)
 
HTH
IP IP Logged
sa-user
Groupie
Groupie


Joined: 29 Jun 2011
Online Status: Offline
Posts: 65
Quote sa-user Replybullet Posted: 13 Jul 2011 at 4:14am
Is there a example or step by step process i can use to test.
 
Am new to CR and this will help..
Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Jul 2011 at 4:21am
not that I am aware of.
 
sorry.
 
Connecting to your database and calling a stored proc is really outside the scope of these forums (there are better references on the web).  The rest is creating an instance of the report, setting the output of the stored proc to the DataSource of the Report (this is heart of solution) and then setting reportViewer to use the report instance is the basic outline.
 
Use a datasource type of ADO.NET for the report.
IP IP Logged
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