Tips and Tricks
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Tips and Tricks
Message Icon Topic: Passing parameter from windows form to Report Post Reply Post New Topic
Author Message
ibanez335
Newbie
Newbie
Avatar

Joined: 26 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote ibanez335 Replybullet Topic: Passing parameter from windows form to Report
    Posted: 26 Apr 2008 at 11:13am
Hi Everyone, this is my first post so I hope I don't breach any of the rules.  I am a recent convert from VB6 to VB2005 studio bundled with CRXI.  I have a windows form with a datagridview linked to an access database.  By clicking on the dgv a single record is displayed in textboxes on the form.  I simply want to copy the textboxes directly to a report using a button. 
I've just got a copy of CR.net programming and I'm wandering whether to just use the primary key displayed on the form as the equivalent of a parameter query for the report - I think chapter 16 might help.
 
Can anyone suggest the best way for me to go?
 
Thanks in advance,
 
Alan
 
p.s. the book lokks just what I was looking for.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 26 Apr 2008 at 12:02pm
Thanks for getting the book! Since you are using CR.NET 2005, please remember that the book is for CR.NET 2003 and the 2005 version has better datasets (faster) and that in ASP.NET you can only use the Load() method to load a report into the ReportDocument object. Also, it is MUCH easier to change parameters using the SetParameterValue() method. The code in the book is only necessary for 2003.

For this report, I would use the primary key of the row that was selected in the grid and pass that as a parameter to the report to be used in the record selection formula. Also, it is easy to manually override the record selection formula and hardcode the primary key into the formula.
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
ibanez335
Newbie
Newbie
Avatar

Joined: 26 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote ibanez335 Replybullet Posted: 26 Apr 2008 at 3:31pm
Thanks for the swift reply Brian,
 
I'll give it a try
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.063 seconds.