Print Page | Close Window

Using Data From TextBoxes?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=375
Printed Date: 17 May 2024 at 10:49pm


Topic: Using Data From TextBoxes?
Posted By: pooba53
Subject: Using Data From TextBoxes?
Date 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



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: pooba53
Date 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.


Posted By: BrianBischof
Date 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>


Posted By: pooba53
Date 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


Posted By: pooba53
Date Posted: 22 Mar 2007 at 3:55pm
Already have book Clap



Print Page | Close Window