Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: "Prompting Text" of a crystal report parameter Post Reply Post New Topic
Author Message
Challenge
Newbie
Newbie


Joined: 19 May 2009
Location: India
Online Status: Offline
Posts: 2
Quote Challenge Replybullet Topic: "Prompting Text" of a crystal report parameter
    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?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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.
IP IP Logged
Challenge
Newbie
Newbie


Joined: 19 May 2009
Location: India
Online Status: Offline
Posts: 2
Quote Challenge Replybullet 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?
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.