|
-
Sep 22nd, 2000, 09:51 AM
#1
Thread Starter
Lively Member
Hi,
Can any one help with passing parameters from vb program to crystal reports.
Example:
Crystal report displays the Customer details from NWind.mdb.
I want to pass the parameter, CustomerID = XYZ.
Any help would be greatly appreciated.
Thank you.
Rathi
-
Sep 27th, 2000, 04:00 AM
#2
New Member
The following should work
CrystalReport1.SelectionFormula = "{CustomerID} = 'xyz'"
Set CrystalReport1.SelectionFormula = "" at end of program or else the report will hold the last Selection Formula
Hope this helps
Mick
[Edited by cautious on 09-27-2000 at 05:05 AM]
-
Sep 27th, 2000, 04:17 AM
#3
Lively Member
Sorry Cautious, but SelectionFormula is the where clause of the SQL and Rahi ask for parameters (for changing this you must use CrystalReport1.ReplaceSelectionFormula = "{CustomerID} = 'xyz'")
For passing parameters, you must use this code
Code:
' Syntax : CrystalReport1.ParameterFields(ArrayIndex)="ParameterName;
NewValue;SetCurrentValue"
' Where :
' ArrayIndex is an index from 0 to the number of parameters to pass (there is no link between parametername and the index number)
' ParameterName is the name of the parameter in the crystal report (case sensitive)
' NewValue is the new value to put to the parameter
' SetCurrentValue is equal to "TRUE" or "FALSE"
' TRUE : the parameter value is passed to the current value in the report; the user is not prompted to enter the parameter value.
' FALSE: the parameter value is passed to the default value for the parameter; the user is prompted to enter the parameter value, with the value you set showing as the default value.
CrystalReport1.ParameterFields(0)="CustomerID;xyz;TRUE"
[Edited by kwell on 09-27-2000 at 05:27 AM]
-
Sep 27th, 2000, 06:25 AM
#4
Thread Starter
Lively Member
Originally posted by KWell
Sorry Cautious, but SelectionFormula is the where clause of the SQL and Rahi ask for parameters (for changing this you must use CrystalReport1.ReplaceSelectionFormula = "{CustomerID} = 'xyz'")
For passing parameters, you must use this code
Code:
' Syntax : CrystalReport1.ParameterFields(ArrayIndex)="ParameterName;
NewValue;SetCurrentValue"
' Where :
' ArrayIndex is an index from 0 to the number of parameters to pass (there is no link between parametername and the index number)
' ParameterName is the name of the parameter in the crystal report (case sensitive)
' NewValue is the new value to put to the parameter
' SetCurrentValue is equal to "TRUE" or "FALSE"
' TRUE : the parameter value is passed to the current value in the report; the user is not prompted to enter the parameter value.
' FALSE: the parameter value is passed to the default value for the parameter; the user is prompted to enter the parameter value, with the value you set showing as the default value.
CrystalReport1.ParameterFields(0)="CustomerID;xyz;TRUE"
[Edited by kwell on 09-27-2000 at 05:27 AM]
Hi Friends,
Thanks for your support.
I'm going to use your suggestions, hope I can come back if I have any difficulties.
Thanks again.
Rathi
-
Sep 28th, 2000, 04:33 AM
#5
Thread Starter
Lively Member
[QUOTE]Originally posted by rathi
[B][QUOTE]Originally posted by KWell
[B]Sorry Cautious, but SelectionFormula is the where clause of the SQL and Rahi ask for parameters (for changing this you must use CrystalReport1.ReplaceSelectionFormula = "{CustomerID} = 'xyz'")
For passing parameters, you must use this code
Code:
' Syntax : CrystalReport1.ParameterFields(ArrayIndex)="ParameterName;
NewValue;SetCurrentValue"
' Where :
' ArrayIndex is an index from 0 to the number of parameters to pass (there is no link between parametername and the index number)
' ParameterName is the name of the parameter in the crystal report (case sensitive)
' NewValue is the new value to put to the parameter
' SetCurrentValue is equal to "TRUE" or "FALSE"
' TRUE : the parameter value is passed to the current value in the report; the user is not prompted to enter the parameter value.
' FALSE: the parameter value is passed to the default value for the parameter; the user is prompted to enter the parameter value, with the value you set showing as the default value.
CrystalReport1.ParameterFields(0)="CustomerID;xyz;TRUE"
[Edited by rathi on 09-28-2000 at 05:35 AM]
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
|