|
-
May 10th, 2001, 10:58 AM
#1
crystal/ parameters
I am new to crystal.Im using version 4. I am trying to pass a parameter to the report and it doesn't seem to even see it. I am connecting to my dbase(access) via odbc.
Here's part of my vb code:
CrystalReport1.SQLQuery = "select * from contact where contact_type = '" & run_type & "' "
Should I just be setting up the query in crystal? If so, what's the format because nothing I try seems to work.
-
May 10th, 2001, 11:24 AM
#2
Re: crystal/ parameters
I use another version of Crystal, so maybe not all of this may apply to you. However, you should be able to set from vb only the where clause of an Sql, not the whole:
Code:
Private Sub Command1_Click()
Dim sql As String
Cr1.Reset
Cr1.ReportFileName = "D:\Condivisa\report\Report04.rpt"
Cr1.ReportSource = 0
Cr1.DiscardSavedData = True
'the where clause
'this, if you do not have a selection formula in your report
sql = "{persona.Cognome}='Imperiali'"
Cr1.SelectionFormula = sql
'replace previous with:
'sql = "{persona.Cognome}='Imperiali'"
'Cr1.ReplaceSelectionFormula sql
'if you have already one in rpt file
Cr1.Action = 1
'or:
'myvar = Cr1.PrintReport
'MsgBox myvar
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
Last edited by Cimperiali; February 5th, 2004 at 06:35 AM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
May 10th, 2001, 01:15 PM
#3
Re: crystal/ parameters
I tried and it still does not work. I get a message "20599". thanks
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
|