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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSRS doesn't recognize passed parameters

Status
Not open for further replies.

mkrausnick

Programmer
Apr 2, 2002
766
0
0
US
This is probably an easy one but I'm stumped. I'm learning SSRS. I created a report based on a view using VS 2008 report designer. It previewed OK in the report viewer. I wanted to add a date range parameter. I changed the query to include the parameters in a where clause:
Code:
SELECT lastname, firstname, street1, street2, city, state, zip, DOB, EnrollStart, EnrollEnd, HomeClinic, memberid, tagname, provid, ProvName FROM dbo.v_AceMember where EnrollEnd between @BegDate and @EndDate
Both parameters have Accept Null Values unchecked and default value Null checked in the Report Parameters window.

I then created a simple VB form with two DateTimePicker fields and a "Go" button, which has this code:
Code:
    Private Sub btn_go_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_go.Click
        Me.v_AceMemberTableAdapter.Fill(Me.OneEApp_AdminDataSet.v_AceMember, Me.dp_begdate.Value, Me.dp_enddate.Value)
        Me.ReportViewer1.RefreshReport()

    End Sub
Debugging the form gets a "ConstraintException was unhandled" error that says "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.".

So clearly the FILL() is not getting the values from the DateTimePicker fields.

What did I miss?

Thanks for your help.

Mike Krausnick
Dublin, California
 
Both parameters have Accept Null Values unchecked and default value Null checked

surely that won't work - if you have accept null values unchecked then it won't accept a null value but your default value is set as null

Maybe you need to not have a default parameter valaue...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks for taking the time. However, the inconsistency in the default setting should not have kicked in, since I supplied parameters in the FILL call. There would have been no need for the system to supply a default value. The problem is the error message indicates the parameters I supplied weren't passed. I just don't know why.

Mike Krausnick
Dublin, California
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top