If you have questions about how to use ActiveReports Parameters collection, take a look at KnowledgeBase Article: 539.
Here is the syntax for the query in the data source when you are using a stored procedure: exec dbo.[Sales by Year] '<%TestVar%>', '01/01/03' Basically, what this code is doing is calling the 'Sales By Year' stored procedure that is in the Northwind database. This stored procedure takes two parameters: Beginning Date and Ending Date. So '<%TestVar%>' is the beginning date and '01/01/03' is the Ending Date. When using the ActiveReport parameter collection you have two ways to pass the parameter value in: - You can prompt the user for the value by setting ShowParameterUI to True
- Or you can pass the value in at run time through code
[C#] ReportName rpt = new ReportName(); rpt.Parameters["TestVar"].Value = "1/19/1992"; rpt.ShowParameterUI = false; rpt.Run(false); this.ARViewer.Document = rpt.Document;
[Visual Basic] Dim rpt As ReportName rpt = New ReportName() rpt.Parameters("TestVar").Value = "1/19/1992" rpt.ShowParameterUI = False rpt.Run(False) Me.ARViewer.Document = rpt.Document
|