Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameters and connecting to crystal reports

Status
Not open for further replies.

Teamgc

Programmer
Feb 15, 2006
37
IE
I use the code below (vb.net) to access my report but it still asks for the discreet value and for conenction details.

How can i do this within my code?

thanks

paramField.ParameterFieldName = "@Area"
discreteVal.Value = "BNK"
paramField.CurrentValues.Add(discreteVal)

paramFields.Add(paramField)

CrystalReportViewer1.ParameterFieldInfo = paramFields
CrystalReportViewer1.ReportSource = "Y:\development\reports\rpt_FIN_CashFlowSummary.rpt
 
Try passing the paramfields into first the report object, and then into the viewer object.


Sweep
...if it works dont f*** with it
curse.gif
 
thanks for the post...

Sorry, I'm a bit lost...

I don't have a report object..

I have a viewer object on the form and i have the folling code in my form load

'***
Dim paramFields As New ParameterFields
Dim paramField As New ParameterField
Dim discreteVal As New ParameterDiscreteValue
Dim rangeVal As New ParameterRangeValue

paramField.ParameterFieldName = "@Area"
discreteVal.Value = "BNK"
paramField.CurrentValues.Add(discreteVal)

paramFields.Add(paramField)
CrystalReportViewer1.ParameterFieldInfo = paramFields

CrystalReportViewer1.ReportSource = "Y:\development\KBReports_New\rpt_FIN_CashFlowSummary.rpt"
'***

Any help would be great, im a vb.net and crystal novice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top