Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Earlier this week I asked a question about passing parameters into a Crystal report. I am following up the question with the following.

I have 2 field e.g. Allocated To and Sales Total in a VB form.
I have a crystal report that depending on the criteria of the 2 fields prints certain information.

I have entered

Allocated To : Alan Smith
Sales Total : 500

On my crystal report has 2 parameters fields ?Allocated and ?SalesTotal.

What I want is that the crystal report parameter fields be automatically populated with the values of the 2 fields.

If I was just doing one parameter it would be like this and this code works

parParameterField.ParameterFieldName = "AllocatedTo"
parParameterValue.Value = "Alan Smith"
parParameterField.CurrentValues.Add(parParameterValue)
parParamFields.Add(parParameterField)

'Assign parameters
MycrRpt.SetParameterValue(parParameterField.ParameterFieldName, parParameterValue.Value)

Question, how do I add another parameter e.g. salestotal
Posted
Updated 11-Aug-11 4:31am
v2

Since you are doing this via code, have a look here[^].
 
Share this answer
 
Comments
Central_IT 11-Aug-11 10:40am    
Hi,
Thanks for getting back. In the example there is only one field "country". I have 2 fields that I want populate Allocated To and Sales Total. Any idea how I would add the extra field to get working.
Hi,

use reportfilename.SetParameterValue(index,value)

for example

?Allocated : if it is first parameter then
reportfilename.SetParameterValue(0,Allocated_To)

?SalesTotal : is Second then

reportfilename.SetParameterValue(1,Sales_Total)

note : index starts from 0

Hope this will help to u...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900