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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting rid of the clucky parameter dialog box

Status
Not open for further replies.

gzuhlk

Programmer
Jul 11, 2003
9
0
0
US
I want to open a report in Vb.net and since I am passing over parameters through code, i'd like to suppress the dialogue box whenever the report is to be shown...

How can I suppress the clucky crystal parameter box from popping up and pass all the parameters through VB code on the form side.

Or is there a way to make the crystal parameter box smaller, if it has to pop up?

How do I do that?
 
I have gone through the sample apps. from crystal, but I still get the "clucky" parameter popup box.

(Vb.Net Professional Edition 2002)

Here are two different ways I have tried:

Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click

''Set the viewer to the report object to be previewed.
Cr.ReportSource = crReportDocument

End Sub

Sub Parameters()

''Set the name of the parameter field, this must match a parameter in the report.

paramField.ParameterFieldName = "ClientName"

''Set the discrete value and pass it to the parameter
discreteVal.Value = txtName.Text
paramField.CurrentValues.Add(discreteVal)

''Set the parameter fields collection into the viewer control.
Cr.ParameterFieldInfo = paramFields
End Sub

Private Sub btnLoadReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadReport.Click
Call Parameters()
End Sub

**************************************

Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As ParameterValues

Friend WithEvents CrystalReportViewer1 As CrystalDecisions.Windows.Forms.CrystalReportViewer

Dim crParameterDiscreteValue As ParameterDiscreteValue
'''Create an instance of the strongly-typed report object
crReportDocument = New CRParams()

'''Get the collection of parameters from the report
crParameterFieldDefinitions = crReportDocument.DataDefinition.ParameterFields
'''Access the specified parameter from the collection
crParameterFieldDefinition = crParameterFieldDefinitions.Item("clientName")

'''Get the current values from the parameter field. At this point
'''there are zero values set.
crParameterValues = crParameterFieldDefinition.CurrentValues

'''Set the current values for the parameter field
crParameterDiscreteValue = New ParameterDiscreteValue()

crParameterDiscreteValue.Value = (txtName.Text)

'''Add the current value for the parameter field
crParameterValues.Add(crParameterDiscreteValue)

'''All current parameter values must be applied for the parameterfield.crParameterFieldDefinition .ApplyCurrentValues(crParameterValues)

******
Any suggestions on how to get this to work, I must be missing something rather simple.


G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top