We have a 2008 ssrs report that runs fine while in reporting services. It has a dataset that calls an sql sp with 3 parameters. I have defined 3 paramters in reporting service and put in default values and have my dataset pointing to these parameters and report opens fine. The problem that I have is when is aspx page and using report viewer control, it doesn't work with parameters. If I run report without parameters, it works so my connections and so on should be good. When I run with parameters, I get the following message:
Parameter validation failed. It is not possible to provide valid values for all parameters. (rsParameterError)
Here is the code from aspx page that I am having the problem with.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Me.ReportViewer1.ServerReport.ReportPath = "/customerreports/report3"
Me.ReportViewer1.ServerReport.ReportPath = "/customerreports/rptupltest"
Dim params(3) As Microsoft.Reporting.WebForms.ReportParameter
params(0) = New Microsoft.Reporting.WebForms.ReportParameter("Customer", "970000")
params(1) = New Microsoft.Reporting.WebForms.ReportParameter("Facility", "01")
params(2) = New Microsoft.Reporting.WebForms.ReportParameter("Commodity", "116")
Me.ReportViewer1.ServerReport.SetParameters(params)
Me.ReportViewer1.ServerReport.Refresh()
Dim result As Byte()
Dim warnings As Microsoft.Reporting.WebForms.Warning() = Nothing
Dim DeviceInfo As String = "<DeviceInfo>" & " <OutputFormat>PDF</OutputFormat>" & "</DeviceInfo>"
' Dim DeviceInfo As String = "<DeviceInfo>" & " <OutputFormat>PDF</OutputFormat>" & " <PageWidth>11in</PageWidth>" & " <PageHeight>8.5in</PageHeight>" & " <MarginTop>0.1in</MarginTop>" & " <MarginLeft>0.1in</MarginLeft>" & " <MarginRight>0.1in</MarginRight>" & " <MarginBottom>0.1in</MarginBottom>" & "</DeviceInfo>"
Dim streamIDs As String() = Nothing
Dim mimeType As String = "application/PDF"
Dim encoding As String = Nothing
Dim extension As String = Nothing
'Render report in PDF format
result = Me.ReportViewer1.ServerReport.Render("PDF", DeviceInfo, mimeType, encoding, extension, streamIDs, warnings)
Response.ClearContent()
Response.ContentType = mimeType
Response.AddHeader("content-disposition", "attachment; filename=Report." & extension)
Response.BinaryWrite(result)
Response.End()
End Sub
I've been working and searching for information on this for hours and no luck yet.
Thanks,
Joe
Parameter validation failed. It is not possible to provide valid values for all parameters. (rsParameterError)
Here is the code from aspx page that I am having the problem with.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Me.ReportViewer1.ServerReport.ReportPath = "/customerreports/report3"
Me.ReportViewer1.ServerReport.ReportPath = "/customerreports/rptupltest"
Dim params(3) As Microsoft.Reporting.WebForms.ReportParameter
params(0) = New Microsoft.Reporting.WebForms.ReportParameter("Customer", "970000")
params(1) = New Microsoft.Reporting.WebForms.ReportParameter("Facility", "01")
params(2) = New Microsoft.Reporting.WebForms.ReportParameter("Commodity", "116")
Me.ReportViewer1.ServerReport.SetParameters(params)
Me.ReportViewer1.ServerReport.Refresh()
Dim result As Byte()
Dim warnings As Microsoft.Reporting.WebForms.Warning() = Nothing
Dim DeviceInfo As String = "<DeviceInfo>" & " <OutputFormat>PDF</OutputFormat>" & "</DeviceInfo>"
' Dim DeviceInfo As String = "<DeviceInfo>" & " <OutputFormat>PDF</OutputFormat>" & " <PageWidth>11in</PageWidth>" & " <PageHeight>8.5in</PageHeight>" & " <MarginTop>0.1in</MarginTop>" & " <MarginLeft>0.1in</MarginLeft>" & " <MarginRight>0.1in</MarginRight>" & " <MarginBottom>0.1in</MarginBottom>" & "</DeviceInfo>"
Dim streamIDs As String() = Nothing
Dim mimeType As String = "application/PDF"
Dim encoding As String = Nothing
Dim extension As String = Nothing
'Render report in PDF format
result = Me.ReportViewer1.ServerReport.Render("PDF", DeviceInfo, mimeType, encoding, extension, streamIDs, warnings)
Response.ClearContent()
Response.ContentType = mimeType
Response.AddHeader("content-disposition", "attachment; filename=Report." & extension)
Response.BinaryWrite(result)
Response.End()
End Sub
I've been working and searching for information on this for hours and no luck yet.
Thanks,
Joe