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
Printable View
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
I am not sure about CR8. In CR9 you can simply pass sql to the queryString method.
Include the reference to CRviewer Control 9 :thumb: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
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
it is not working with CR8.
Use a parameter field
Note: This is using the ReportViewer Component. But I think the concept is same.Code:Reports.ParameterFields(0) = "paramName;" & text1.text & ";true"
Parameters are accessed by thier index
.ParameterFields(0)
And the order has to be the EXACT order in the report.
:wave:
Moved to reporting
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
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?
:confused:
am using crystal report component. tomorrrow only i can post u my code.Quote:
Originally Posted by zeezee
in CR Component it shoud be like this.Quote:
Originally Posted by sajankk
Assume your report source name is m_Report
:wave:Code:m_Report.ParameterFields(1).AddCurrentValue "testValue"
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
Quote:
Originally Posted by bhamres
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....
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
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.
:wave:
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?Quote:
Originally Posted by mabbas110
BTW, I wonder whether the OP has got his answer or not :confused: