|
-
Nov 4th, 2002, 04:19 PM
#1
Thread Starter
Addicted Member
Help..on passing params to Crystal reports from VB5
I am using VB5.0 and crystal reports 8.5 .
New to crystal reports.
could someone clarify some basic question please.
1. should I use "Crystal reports" control or "Crystal report viewer"
2. I have a report and I need to pass 3 parameter from my VB screen. How can I do that?
thank you
nath
-
Nov 5th, 2002, 02:01 AM
#2
New Member
I think u should use crystal report viewer so that u can have select statement there. It will be easy to pass those parameters of your.
-
Nov 5th, 2002, 03:26 PM
#3
Lively Member
it's been a while since I used Crystal Report from VB, but I used
CR control:
with CR1
.Connect = "ODBC;DATABASE=mm;UID=abx;PWD=abx;DSN=hh"
.ReportFileName = App.Path & "\" & "myreport.rpt"
strSelect =" {mytable.myfield} ='abc' "
.SelectionFormula = strSelect
end with
-
Nov 5th, 2002, 03:32 PM
#4
Lively Member
Addition:
you have to set CR1.Action = 1 in order to view report
-
Nov 5th, 2002, 03:37 PM
#5
Hyperactive Member
If you use the crviewer and need to pass more than one paramater in code here is what I put in the viewer
Dim crpParamDef As CRAXDRT.ParameterFieldDefinition
For Each crpParamDef In Report.ParameterFields
Select Case crpParamDef.Name
Case "{?Location}"
crpParamDef.AddCurrentValue (CLng(frmStartInvAssignVolByCo.txtLocation.Text))
Case "{?MasterCompany}"
crpParamDef.AddCurrentValue (CLng(frmStartInvAssignVolByCo.txtCoID.Text))
Case "{?StartDate}"
crpParamDef.AddCurrentValue CDate(frmStartInvAssignVolByCo.txtStartDate.Text)
Case "{?EndDate}"
crpParamDef.AddCurrentValue CDate(frmStartInvAssignVolByCo.txtEndDate.Text)
End Select
Next
--------------
The paramaters are input by the user on a form that preceeds the viewer
-
Nov 5th, 2002, 05:36 PM
#6
Thread Starter
Addicted Member
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
|