Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SetParameterValue not doing what it says!!!!!

Status
Not open for further replies.

ChubbyArse

Programmer
May 20, 2003
13
GB
Hi all,

I'm having trouble setting a boolean parameter in a crystal report which I'm calling from a VB.net windows Form application.

The parameter is called ShowScrappedOnly and is set to a boolean.

This is the code that I try to set the value with:

Code:
rptReport.ReportDocument.SetParameterValue("ShowScrappedOnly", chkScrappedOnly.Checked)

chkScrappedOnly.Checked is a checkbox on a form and evaluates to True or False.

When the report is run the parameter dialog box comes up asking for the parameter I've just set. However, if I spell the parameter name wrongly it gives an error of "Invalid Field Name"

I include this line to check the value of the parameter:
Code:
rptReport.ReportDocument.DataDefinition.ParameterFields("ShowScrappedOnly").CurrentValues.Count
and it gives me 1.

It's obvious that the report is not getting the value that I set, as the dialog is popping up, but on the flip-side if I set the parameter with the wrong name it complains???

Any ideas on this anyone?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top