Print Page | Close Window

"Prompting Text" of a crystal report parameter

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6406
Printed Date: 02 May 2025 at 5:47pm


Topic: "Prompting Text" of a crystal report parameter
Posted By: Challenge
Subject: "Prompting Text" of a crystal report parameter
Date Posted: 19 May 2009 at 11:41pm

Hello,

My problem is in changing the crystal report (version 8.5) paramter in Visual Basic6.0
 
I would like to change the "Prompting Text" of a crystal report parameter. If I consider the dbobject as View then I am able to do this with the following line

CrRep.ParameterFields(1).Prompt = "MyString"

PROBLEM:
If the Parameter is a input field of a stored procedure, and i try to do the same:
CrRep.ParameterFields(1).Prompt = "MyString"

I am receiving the following error:
"Not Report Parameter."
Error Number: -2147189575 (80047cb9)

Is there any solution for this problem?


-------------
~Can u?



Replies:
Posted By: lockwelle
Date Posted: 20 May 2009 at 6:50am
OK, call me silly, but it would seem that you are working too hard....
Why change the prompt?  Why not get all the values you need for the stored proc from a VB6 form and then call the stored proc and return the dataset to the report.  VB is way more versatile for the display of parameter options than Crystal is.  It is what my company uses, and I have never been happier to not have to deal with Crystal's parameter input screen.
 
The other solution, and I am by no means an expert because I don't code this way, is to use the name of the parameter instead of an index (this might not be available in VB6).  You might also try printing what the current value of prompt is in the immediate window, which might help.
 
also you might try getting the number of parameterfields in the report and their names, you might find that something else is amiss.
 
Hope of some of this helped.


Posted By: Challenge
Date Posted: 20 May 2009 at 7:05am
Hi lockwelle,
   Thanku for the response.
 
Acutally, My requirement is to change default values of a Crsytal report parameter for a bluk of reports manually. It will take some 580hours. Instead of doing manually, i'm using VB to change the parameters. It will done less than 5 min.  (i.e Automation)
 
I am accessing the parameter fields and change the default values.
My problem is to change the parameter prompt only.
 
Find the code below.
 
'Displaying the prompt as u said above - It is working
MsgBox CrRep.ParameterFields.GetItemByName(paramname).Prompt
(Ex: Select Contract type description)
'It throws the error while changing the prompt value
CrRep.ParameterFields.GetItemByName(paramname).Prompt = "Enter the Contract Type Description"
 
 


-------------
~Can u?



Print Page | Close Window