Right i've followed a guide and got a VB program working with Crystal Reports. So i added my own report and that worked ok.
Now i want to pass two parameters to the report. This is where i need help, i've googled but can't find any guides/samples that pass two parameters e.g. Date and Supplier.
Below is the code for passing just one parameter. Anyone able to modify it so i can pass two. Thanks
VB Code:
Imports CrystalDecisions.Shared Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CrystalReportViewer1.DisplayGroupTree = False CrystalReportViewer1.ShowPrintButton = True End Sub Private Sub Button1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myParameterFields As New ParameterFields Dim myParameterField As New ParameterField Dim myDiscreteValue As New ParameterDiscreteValue myParameterField.ParameterFieldName = "DataDate" myDiscreteValue.Value = DateTimePicker1.Text myParameterField.CurrentValues.Add(myDiscreteValue ) myParameterFields.Add(myParameterField) CrystalReportViewer1.ParameterFieldInfo = myParameterFields CrystalReportViewer1.ReportSource = New CCReport CrystalReportViewer1.Refresh() End Sub End Class
I've tried passing two parameters but only one seems to work. Sorry but i'm a bit of a newbie to both Crystal Reports and VB




Reply With Quote