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

vb.net - pass parameter to rdlc, report not defined exception

Status
Not open for further replies.

cdck

Programmer
Nov 25, 2003
281
US
I'm working in Visual Studio 2012 on a vb.net winforms project originally created in Visual Studio 2008. Since converted, the .rdlc files have started giving me issues, but I thought I had cleared them up with an updated reference.

Currently, I'm working on passing two parameters from a form to the report before refreshing it in the viewer. When the form is first opened, the blank report displays correctly. However, when I fire the code to fill the report, I get an error telling me that {"An error occurred during local report processing."}, with an innerException of {"The report definition for report 'TimesheetManager.Absences' has not been specified"}.

Here is the code that passes the parameters and refreshes the report:
Code:
Me.txtAbsRepTitle.Text = "Employee Absences between " & Me.dtAbsStart.Text & " and " & Me.dtAbsStop.Text
Me.rvAbsenceReports.LocalReport.ReportPath = "TimesheetManager.Absences.rdlc"
Dim RepTitl As String = Me.txtAbsRepTitle.Text
Dim RepInc As String = Me.txtAbsRepInc.Text
Dim RepTitle As New ReportParameter("ReportTitle", RepTitl, False)
Dim RepIncs As New ReportParameter("ReportInclusions", RepInc, False)
Dim parms(1) As ReportParameter
parms(0) = RepTitle
parms(1) = RepIncs
Me.rvAbsenceReports.LocalReport.SetParameters(parms)
Me.rvAbsenceReports.LocalReport.Refresh()

The error occurs at "Me.rvAbsenceReports.LocalReport.SetParameters(parms)"

Following extensive research online, I went to the Properties of Absences.rdlc and set the Build Action to "Content" with a Copy to Out of "Copy Always", but then the report doesn't load in the viewer at all, giving the same message. All the solutions I've found online come back to using the root namespace when setting the report path, but I've done that; the root namespace is TimesheetManager.

Any help would be appreciated.

Cheryl dc Kern
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top