Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Help Needed in passing parameter Post Reply Post New Topic
Author Message
Vamp10988
Newbie
Newbie


Joined: 12 Aug 2011
Online Status: Offline
Posts: 4
Quote Vamp10988 Replybullet Topic: Help Needed in passing parameter
    Posted: 20 Aug 2011 at 7:37pm
Hello everyone, I am trying to create a report for a single record and as such am trying to pass parameters to a crystal report but I am not sure exactly how to do this. This is my own method that I am employeeing. I do not want to create a data table and put all the info I need in there and then base a report off of it. I do not want to deal with loops and arrays right now. I just want to pass for example parameter JuvenileID = 1 to my crystal report, then create a command under the database expert and set the parameter for my command to the parameter I passed my crystal report. How would I go about in doing this? I am using VS 2010 C#. This is a windows application. I have a dataentry form that is already populated with the info needed for the report. I just need to pass all the controls.text values to the report and populate it that way.
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 22 Aug 2011 at 7:20am
I dont have  the code in front of me but there are a couple of ways to approach what you want.
 
The first is parameters are a collection in CR so you  can refer to the parameters by their name or index and assign the value of the VS control to parameter. You do need to take care with the data types so as to avoid the mismatch error.
 
The second way would be to create your report and populate it with report items such as textboxes. You can give these items names perhaps to match your VS naming conventions. The text controls can be referenced,  I believe within the report defintions class, then pass the value into the controls. Keep in mind that that the report definitions are a reflection of the report design, so specific reference should be made to controls within the header, group headers and footers, detail sections, etc. 
 
I am sorry I dont have sample code to offer with me, perhaps someone can provide or add more clarity to what I have presented.
 
Hope this is of some help.
 
Regards,
 
John W.
 
 
 
 
 
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.