Solved

passing parameter from vb.net to crystal report

Posted on 2004-10-17
4
265 Views
Last Modified: 2010-08-05
Hello All.
I am having a problem with vb.net 2003 and passing a parameter to a crystal report 9 with a parameter field.  I have the parameter defined in crystal.  I am trying to pass the parameter this way.

oRpt.SetParameterValue("?pfAssetID", "AssessmentId")

The ?pfAssestID is in my crystal report and the AssessmentId field is from my vb program.

When I run the program I get invalid field name.

I have tried so many ideas from previous posts that I don't know what to do next.

Any ideas?


BTW:  I have applied all upgrades and patches to vb.net so that it is using 9.2 version in .net
Jan
0
Comment
Question by:jgraver
  • 3
4 Comments
 
LVL 6

Accepted Solution

by:
RaisinJ earned 125 total points
ID: 12332866
I'm sure you know the error looks to be caused by your Parameter Name...

Did you try oRpt.SetParameterValue("{?pfAssetID}", "AssessmentId")?

Try trouble shooting...  Try to pull the CR's Parameter Names out of the collection and display them so you can see how CR names them.  This may help you determine how you have to pass them in.  (The Parameter Name that is.)
0
 

Author Comment

by:jgraver
ID: 12332915
I corrected the setparametervalue and still get the same error.  How do I display the CR collection?
0
 

Author Comment

by:jgraver
ID: 12333533
I have tried everything....  I still get invalid field.  I have checked my assessmentid and it has data in it.  So I think that it must be the parameter field...
I can see the CR in the watch.  Parameter field has a ?pfAssetID in it.
If I want to use a selectionformula in VB.  Do I need anything in the CR?
Jan
0
 

Author Comment

by:jgraver
ID: 12350354
I have changed the program to use the selection function of CR Viewer and was able to make it work...
Thanks everyone
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now