?
Solved

passing parameter from vb.net to crystal report

Posted on 2004-10-17
4
Medium Priority
?
270 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 6

Accepted Solution

by:
RaisinJ earned 375 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

762 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