I need a serious help in reportviewer.
I seen a lot links, tried a lot codes every way but cannot find a proper solution.
Please make me understand and clear my doubts even.
Totally confused which dataset to select during code and what is datasource.value thing which gives me error everytime...
I am showing the steps how I created the report and trying to make it work. This because I might have done any mistake in creating the reports and you people may catch it.
Now the problem is described below,
I have many .rdlc reporting my project.
What I done is
Note : Reportviewer containing form name is Reports.vb
RDLC reports are Reports1.rdlc,Report2.rdlc,...
1) Created Report like Add -> New Item -> Reporting -> Report -> Report1.rdlc
Report Name: Report1.rdlc
2) Then I add dataset from here like this …
3) DataSet properties opens, it even opens DataSource configuration Wizard.
I select stored procedures because I want to fetch data from my stored procedures and pressed Finish.
Here DataSet Name is BonnyDataSet
4) After that, I select data source from dataset properties…
Now what is this Available datasets here in the last…???
And which dataset I have to consider during loading in ReportViewer???
5) Now I organised the column by adding the data columns from dataset1 shown below…
6) Now I added Reportviewer in form Reports.vb and tried a lot of codes….
Showing some of them here.
Private Sub Reports_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
'Select Case PubRepVar
'Case "AccMast"
Dim data As New BonnyDataSet
Dim rds = New ReportDataSource("BonnyDataSet", data)
ReportViewer.LocalReport.DataSources.Clear()
ReportViewer.LocalReport.DataSources.Add(rds) ‘------error here
ReportViewer.LocalReport.ReportEmbeddedResource = "YourProjectNamespace.Report1.rdlc"
ReportViewer.RefreshReport()
'End Select
Catch ex As Exception
MessageBox.Show(ex.Message, My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
I get the error as following:
BC30311 : Value of type 'ReportDataSource' cannot be converted to
'ReportDataSource'
I have no Idea on this error.
Another code I tried is
ReportViewer.ProcessingMode = ProcessingMode.Local
Dim localReport As LocalReport
localReport = ReportViewer.LocalReport ‘-------error here
localReport.ReportEmbeddedResource =
"ReportViewerIntro.Report1.rdlc"
Dim dataset As New DataSet("BonnyDataSet")
Here error shows like :
BC30311 : Value of type 'LocalReport' cannot be converted to
'LocalReport'.
And I tried many other but can’t understand what the problem is.
Am I doing something wrong during the creation of .rdlc reports???
Needed help eagerly. Thanx
See Question&Answers more detail:
os