|
-
Oct 3rd, 2007, 12:59 AM
#1
Thread Starter
Hyperactive Member
how to pass text box value to report
hi all,
i want to pass the text box value from the VB6 form to crystal report. am using cystal report 8.0. please help me it is urgent.....
saj
-
Oct 3rd, 2007, 01:17 AM
#2
Frenzied Member
Re: how to pass text box value to report
I am not sure about CR8. In CR9 you can simply pass sql to the queryString method.
vb Code:
Dim appln As New CRAXDDRT.Application
Dim Report As New CRAXDDRT.Report
Private Sub Form_Load()
Set Report = appln.OpenReport(Location of your reportfile & "\reportname.rpt")
Report.Database.Tables(1).Location = Location of your database & "\databasename.mdb"
Report.SQLQueryString = SQL
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
End Sub
Include the reference to CRviewer Control 9
-
Oct 3rd, 2007, 01:22 AM
#3
Hyperactive Member
Re: how to pass text box value to report
You can try add a formula fields to Crystal Report
if you are using crystal report control component
try this
vb Code:
With crystalreportCtrl
.reset
.Datafiles(0) = -- your database path --
.ReportFileName = -- your crystalreport path --
.Formulas(0) = "YourFormulaName = '" & textbox1.text & "'"
.Action = 1
end with
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Oct 3rd, 2007, 01:22 AM
#4
Thread Starter
Hyperactive Member
Re: how to pass text box value to report
it is not working with CR8.
-
Oct 3rd, 2007, 03:34 AM
#5
Frenzied Member
Re: how to pass text box value to report
Use a parameter field
Code:
Reports.ParameterFields(0) = "paramName;" & text1.text & ";true"
Note: This is using the ReportViewer Component. But I think the concept is same.
Parameters are accessed by thier index
.ParameterFields(0)
And the order has to be the EXACT order in the report.
Last edited by zeezee; Oct 3rd, 2007 at 03:35 AM.
Reason: typo
-
Oct 3rd, 2007, 06:57 AM
#6
Re: how to pass text box value to report
-
Oct 7th, 2007, 03:01 AM
#7
Thread Starter
Hyperactive Member
Re: how to pass text box value to report
hi guys,
still i didnot get the result. any suggestions. i try all the way u people suggested. but still the value is not coming to the report. please help in this regards
saj
-
Oct 7th, 2007, 04:14 AM
#8
Frenzied Member
Re: how to pass text box value to report
Could you post your code please. And if possible, the report also.
The parameter field works well with reports. If you use a parameter field, if thats not passed, the report viewer it self would prompt to that.
What are you using, Report Viewer control or Crystal Report component?
-
Oct 8th, 2007, 04:49 AM
#9
Thread Starter
Hyperactive Member
Re: how to pass text box value to report
 Originally Posted by zeezee
Could you post your code please. And if possible, the report also.
The parameter field works well with reports. If you use a parameter field, if thats not passed, the report viewer it self would prompt to that.
What are you using, Report Viewer control or Crystal Report component?

am using crystal report component. tomorrrow only i can post u my code.
-
Oct 8th, 2007, 11:23 PM
#10
Frenzied Member
Re: how to pass text box value to report
 Originally Posted by sajankk
am using crystal report component. tomorrrow only i can post u my code.
in CR Component it shoud be like this.
Assume your report source name is m_Report
Code:
m_Report.ParameterFields(1).AddCurrentValue "testValue"
-
Oct 18th, 2007, 06:16 AM
#11
New Member
Re: how to pass text box value to report
Hi ,
i want to pass two values that is Date from form to Datareport as parameter to command where the command is.
SELECT * FROM DD where date_col_1 <= DD_DATE and date_col_2 >= DD_DATE
-
Oct 23rd, 2007, 10:48 AM
#12
Member
Re: how to pass text box value to report
 Originally Posted by bhamres
Hi ,
i want to pass two values that is Date from form to Datareport as parameter to command where the command is.
SELECT * FROM DD where date_col_1 <= DD_DATE and date_col_2 >= DD_DATE
try parameters....i think it has a parameter class info back in vb 6. ofcourse you will have to have thesame name and order of parameters in both your code and report....
-
Nov 1st, 2007, 01:52 AM
#13
New Member
want to create an application for database
want to create an application for database like add delete update options.
plz can u send me the sample application or code.Actually i did for add option but i wont able to create for update and delete.How to modify particular record and delete particular record
-
Nov 1st, 2007, 05:55 AM
#14
Frenzied Member
Re: how to pass text box value to report
What you ask is something you wont get easily in here. Here you would get answers to your problems, but I dont think any body would code for you. (I may be wrong.)
BTW, you have to open a new thread for your problems since the OP asks about crystal reports , neither Data Base question Nor Data Reoport question.
-
Nov 8th, 2007, 02:01 AM
#15
Addicted Member
Re: how to pass text box value to report
I would prefer that you create sp and pass two parameters in parameters. That parameter will aslo come in report with the same name added "@" , after that u just need to pass report parameters from code and you can get the desired result. Let me know if my point is clear or not.
Thanks and Regards,
Muhammad Abbas
-
Nov 8th, 2007, 02:26 AM
#16
Frenzied Member
Re: how to pass text box value to report
 Originally Posted by mabbas110
I would prefer that you create sp and pass two parameters in parameters. That parameter will aslo come in report with the same name added "@" , after that u just need to pass report parameters from code and you can get the desired result. Let me know if my point is clear or not.
You mean a SP in the DB? or CR?
BTW, I wonder whether the OP has got his answer or not
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|