ActiveReports3 Request technical support
Parameters Property
See Also  Example


Returns a reference to the data source query parameters collection.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Parameters As ParameterCollection
Visual Basic (Usage)Copy Code
Dim instance As ActiveReport3
Dim value As ParameterCollection
 
value = instance.Parameters
C# 
public ParameterCollection Parameters {get;}

Return Value

An initialized Parameters collection.

Example

C#Copy Code
Private void viewer1_HyperLink(object sender, DataDynamics.ActiveReports3.Viewer.HyperLinkEventArgs e)
{    
   rptDrillDown1 rpt2 = New rptDrillDown1();    
   frmViewDrillDown1 frm2 = New frmViewDrillDown1();    
   rpt2.Parameters[
"customerID"].Value = e.HyperLink.ToString();    
   rpt2.Run();    
   frm2.viewer1.Document = rpt2.Document;    
   frm2.ShowDialog(
this);
}
Visual BasicCopy Code
Private Sub Viewer1_HyperLink(ByVal sender As Object, ByVal e As DataDynamics.ActiveReports3.Viewer. _
    HyperLinkEventArgs) Handles Viewer1.HyperLink
    Dim rpt2 As New rptDrillDown1()
    Dim frm2 As New frmViewDrillDown1()
    rpt2.Parameters("customerID").Value = e.HyperLink.ToString
    Console.WriteLine(rpt2.ds.SQL.ToString)
    rpt2.Run()
    frm2.Viewer1.Document = rpt2.Document
    frm2.ShowDialog(Me)
End Sub

Remarks

The parameters collection is automatically populated when the report is started.  If parameters are specified in the report's DataSource, they will be added to the collection. 

For example, setting your RecordSource to the following SQL adds "Order Date" and "Order ID" to the parameters collection.

"SELECT * FROM orders WHERE OrderDate >= #<Order Date|Enter Order date|1/1/1995># AND OrderID > <OrderID|Order ID>"

You can set the parameter values before the report starts or allow ActiveReports to collect the values from the user at run time.

Note:  Depending on your data source, you may need to add pound signs around the parameter syntax for dates (as in the "Order Date" example above) or apostrophes around the parameter syntax for strings, i.e. "SELECT * FROM Customers WHERE CustomerID = '<CustomerID>'"

See Also