Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: can I send variable from vs2005 to report Post Reply Post New Topic
Author Message
cwillsh
Newbie
Newbie
Avatar

Joined: 20 Dec 2007
Location: United States
Online Status: Offline
Posts: 4
Quote cwillsh Replybullet Topic: can I send variable from vs2005 to report
    Posted: 20 Dec 2007 at 8:07am

From Visual Studio 2005, I have a form that contains a Crystal Reports Viewer control.  At runtime, I create a new ReportDocument class and specify the 'report path and name' and the 'report paramenter value'.  Then I set the viewer's ReportSource to the above class which loads the report into the viewer control.  My question is: 'Is there a way to pass a string variable from Visual Studio to the report so I can print that variable in the report header?'

All of my reports are using SqlServer Stored procs and the parameter value I am sending above correlates to the parameter needed by the stored proc.

Thanks for your help,
cwillsh
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 21 Dec 2007 at 4:38am
Yes.  The simplest way to do this is to create a parameter field in your report, and just pass the string to the parameter.  The ReportDocument class also has a number of other properties and functions which can be used to do things like this.  You should get Brian's book on Crystal and .Net.  It explains everything you can do really well.


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.047 seconds.