Answered by:
Report1.rdlc has not been specified ...error in Reportviewer

Question
-
Hi friends .
in my project i have use the reportviewer control use to report the two reports . but kind of error occur the reportviewer run time.
Report1.rdlc has not been specified . .
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim rds As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource
Me.ReportViewer1.Reset() 'Reset control to clear previous report information
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "\ASSS Accounting\report1.rdlc"
Me.ReportViewer1.LocalReport.DataSources.Clear()
Me.ReportViewer1.RefreshReport()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.ReportViewer1.Reset() 'Reset control to clear previous report information
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "ASSS Accounting.Report2.rdlc"
Me.ReportViewer1.LocalReport.DataSources.Clear()
Me.ReportViewer1.RefreshReport()
End Sub
plz help the pbm. thank you
Wednesday, November 7, 2012 6:51 AM
Answers
-
Hi,
Please try this code:
Dim ds As New WaterTablesDataSet Dim ta As New WaterTablesDataSetTableAdapters.GroupLotsForUsersTableAdapter ta.Fill(ds.GroupLotsForUsers) Me.ReportViewer1.LocalReport.ReportPath = "c:\aquadatatest\aquadatavb2010\report1.rdlc" Me.ReportViewer1.LocalReport.DataSources.Clear() Dim sReportDataSource As ReportDataSource sReportDataSource = New ReportDataSource() sReportDataSource.Name = "DataSet1" sReportDataSource.Value = ds.GroupLotsForUsers ReportViewer1.LocalReport.DataSources.Add(sReportDataSource) Me.ReportViewer1.RefreshReport()
You can do one thing if issue fixing is urgent.
As i used the complete physical path for the report file, keep it in App.Config file and read from there.
This code works!
OR
If you are using embedded resource then a BIG NOTE:
The RootNamespace and report name must be case sensitive this applies to the datasources names aswell
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "\ASSS Accounting\report1.rdlc"
- Edited by DhavalPanchal247 Wednesday, November 7, 2012 8:04 AM
- Proposed as answer by DhavalPanchal247 Wednesday, November 7, 2012 8:19 AM
- Marked as answer by Madasamyponraj Wednesday, November 7, 2012 9:17 AM
Wednesday, November 7, 2012 8:01 AM
All replies
-
Hi,
Please try this code:
Dim ds As New WaterTablesDataSet Dim ta As New WaterTablesDataSetTableAdapters.GroupLotsForUsersTableAdapter ta.Fill(ds.GroupLotsForUsers) Me.ReportViewer1.LocalReport.ReportPath = "c:\aquadatatest\aquadatavb2010\report1.rdlc" Me.ReportViewer1.LocalReport.DataSources.Clear() Dim sReportDataSource As ReportDataSource sReportDataSource = New ReportDataSource() sReportDataSource.Name = "DataSet1" sReportDataSource.Value = ds.GroupLotsForUsers ReportViewer1.LocalReport.DataSources.Add(sReportDataSource) Me.ReportViewer1.RefreshReport()
You can do one thing if issue fixing is urgent.
As i used the complete physical path for the report file, keep it in App.Config file and read from there.
This code works!
OR
If you are using embedded resource then a BIG NOTE:
The RootNamespace and report name must be case sensitive this applies to the datasources names aswell
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "\ASSS Accounting\report1.rdlc"
- Edited by DhavalPanchal247 Wednesday, November 7, 2012 8:04 AM
- Proposed as answer by DhavalPanchal247 Wednesday, November 7, 2012 8:19 AM
- Marked as answer by Madasamyponraj Wednesday, November 7, 2012 9:17 AM
Wednesday, November 7, 2012 8:01 AM -
in ur code "
GroupLotsForUsers
mention wat?
Wednesday, November 7, 2012 8:10 AM -
Thank you so much Dhaval....now working fine...Wednesday, November 7, 2012 8:18 AM
-
Please mark my above answer as "Correct Answer" if it worked for you or a Requesting moderator to do it.
Thanks
- Edited by DhavalPanchal247 Wednesday, November 7, 2012 8:24 AM
Wednesday, November 7, 2012 8:19 AM