×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Passing Parameters from VS2008

Passing Parameters from VS2008

Passing Parameters from VS2008

(OP)
Hi Everyone,

I am not sure if this is the right forum but I will post it here and see.

I have a VS2008 Gridview, above the Gridview I have a Dropdown Control which filters the data in the GridView for the selected Year.

Attachted to this Gridview I have a Crystal report with similar data of the Gridview.

In this Crystal report I have now got a Parameter for the year as well.

So currently, the user must select a Year for the Gridview and hten when they want to print the report, they need to select the Year for the report as well.

Is there any way of passing the value in the DropDownList Control in VS2008 to the Parameter field used in Crystal?

Any assistence with this would be much appreciated.

Regards
Thomas

RE: Passing Parameters from VS2008

Here's an example of passing parameters from the crystal viewer to the crystal report:

crReport.SetParameterValue("LocID", txtLocID.Text)
        crReport.SetParameterValue("CustID", txtCustID.Text)
        crReport.SetParameterValue("OrderID", txtOrderID.Text)

        crViewer1.ReportSource = crReport
The fields in "" are the parameters in the crystal report.

Good Luck
Cathy

RE: Passing Parameters from VS2008

(OP)
Hi MzKitty,

Its not passing it form the viewer to teh report where I am having problems.

The issue is passing from a dropdown field (created in Visual Studio on a webpage) and making this the parameter field within the report, if this makes sense.

Any ideas?

Thomas

RE: Passing Parameters from VS2008

What type of control is it? Is it a checkbox?
Cathy

RE: Passing Parameters from VS2008

If the dropdown control filters the year then extract the year from it and put it in a variable that you can pass to the report.  For example:
 
dim intYear as integer
datYear = cdate(year(ctrlYear.datavaluefield)
crReport.SetParameterValue("Year", datYear)

Cathy

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close