Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Using Data From TextBoxes? Post Reply Post New Topic
Author Message
pooba53
Newbie
Newbie


Joined: 17 Mar 2007
Online Status: Offline
Posts: 16
Quote pooba53 Replybullet Topic: Using Data From TextBoxes?
    Posted: 21 Mar 2007 at 7:39am
I understand how to use data contained in an Access db within my CR document.

What I don't understand (and would like to) is how to use data that resides in my VB .NET 2003 textboxes within my report. I have some textboxes that are not bound to Access data and are generated while the application is running.

Thanks.
-Dan
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 21 Mar 2007 at 10:35am
There are a couple of ways to do this but the easiest way I can think of to do this is to create some parameters in the report and, in your VB code that runs the report, set the parameters based on the data in the textboxes.
 
-Dell
IP IP Logged
pooba53
Newbie
Newbie


Joined: 17 Mar 2007
Online Status: Offline
Posts: 16
Quote pooba53 Replybullet Posted: 22 Mar 2007 at 3:39pm
Is there a section in Brian's book that illustrates this or can somebody provide some additional details on how this is accomplished?

Thanks a ton.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 22 Mar 2007 at 3:51pm
Yeah, I've got a whole chapter on it. But the 'quick and dirty' way to pass data is using report formulas. Only requires one line of code, and you have to make sure the formula text matches what you would see in Crystal Reports EXACTLY.

ReportObject.DataDefinition.FormulaFields("formula").Text = "..."

But hey, don't let me talk you out of buying the book. 
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
pooba53
Newbie
Newbie


Joined: 17 Mar 2007
Online Status: Offline
Posts: 16
Quote pooba53 Replybullet Posted: 22 Mar 2007 at 3:53pm
Cancel last request...

Create parameter on report called "PM1".

In your code do something like:
MyReport.SetParameterValue("PM1", Val(TextBox146.Text))

Works great...hope this helps someone.

-Dan
IP IP Logged
pooba53
Newbie
Newbie


Joined: 17 Mar 2007
Online Status: Offline
Posts: 16
Quote pooba53 Replybullet Posted: 22 Mar 2007 at 3:55pm
Already have book Clap
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.031 seconds.