Dear Brian,
I am a member of your E-Books on-line(userid: naglesys) and the books have been very helpful.
But, I am still facing the problem in following context.
Sub: Passing of Parameters to SP of SubReport
I had sent you following query on CRystalReportsBooks.com and you had replied to it. But, when I read Chapter 17, I did not get information about passing parameters to the Stored procedure used as a dataSource of SubReport. I tried all you had mentioned in your reply but I still get the message missing Parameter value.
I give below my code. So, pl. tell me what to Do.
Background:
1. I have a Main Report whose Data source is a Stoted Procedure with two input Parameters @P_FINYEAR and @P_DEPT. These are shown by CR in Parameter List.
2. I have a sub-report(embeded in Main Report), whose data source is also a Stored Procedure with two input Parameters @P_FINYEAR and @P_DEPT . These are also shown in parameter list of SubReport.
3. The Main and sub Reports are linked based on two Fields of the Datasource viz. FINYEAR and DEPT.
4. I have been passing parameters to Main & Sub Reports as follows:
Dim ocrListTax as crListTax (which is class for my rpt file)
Dim oSubReport as new ReportDocument
ocrListTax = New crListTax
ocrListTax.SetDatabaseLogon(’abc’,'pqr’,'NS-01′,’nsdb’)
ocrListTax.SetParameterValue(@P_FINYEAR “, intFinYear)
ocrListTax.SetParameterValue(”@P_DEPT”, strDept)
oSubReport = ocrListTax.OpenSubReport(”crSubReport.rpt”)
oSubReport.SetParameterValue(@P_FINYEAR “, intFinYear)
oSubReport.SetParameterValue(”@P_DEPT”, strDept)
ocrListTax.ExportToDisk(ExportFormatType.PortableDocFormat, ‘d:FinTax.pdf’)
ocrListTax.Close()
The Problem
It still gives me missing parameter value error.
(CR2003.Net version is used by me. The error also appears in CR2005.Net)
Note: The Quick Watch(debug option) shows that it is a subreport and it is loaded and yet the error of missing parameter value continues.
Regards,
Dilip Nagle