Print Page | Close Window

Missing Parameter value for parameters used in a s

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Talk with the Author
Forum Discription: Ask Brian questions about his books and give him your comments. Like the book? Hate the book? Have suggestions? Let me know!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3010
Printed Date: 20 Apr 2025 at 10:26am


Topic: Missing Parameter value for parameters used in a s
Posted By: Dilip Nagle
Subject: Missing Parameter value for parameters used in a s
Date Posted: 23 Apr 2008 at 8:45pm

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



-------------
Dilip Nagle



Replies:
Posted By: BrianBischof
Date Posted: 24 Apr 2008 at 8:09am
Hi Dilip. I just posted a response in the eBook area where you posted this question.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window