Hi,
I have written my first report using Report Builder 3.0, which works fine from the Report Viewer itself. In my VB.Net application I have added a Report Viewer control to a form and used some code kindly supplied on the Internet to point to the report etc, but although the form opens nothing is shown on it.
Every example I can find seems to indicate that I have to define the report's datasets in code, but in this case I defined them in the report itself. Is this why it won't work?
Here's the code;
Imports Microsoft.Reporting.WinForms
Public Class frmReportViewer
Private Sub frmReportViewer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim p() As ReportParameter
With ReportViewer1
.ProcessingMode = ProcessingMode.Local
.LocalReport.ReportPath = "C:\Users\Reg\Documents\Visual Studio 2013\Projects\FaSE1\FaSE1\FSEStatement.rdlc"
.LocalReport.ReportEmbeddedResource = "C:\Users\Reg\Documents\Visual Studio 2013\Projects\FaSE1\FaSE1\FSEStatement.rdlc"
Me.ReportViewer1.Refresh()
p(0) = New ReportParameter("partnerstatementid", 14)
p(1) = New ReportParameter("Parameter1", "EASTPOOL")
.LocalReport.SetParameters(p)
.RefreshReport()
End With
End Sub
End Class
Cheers
Reg
I have written my first report using Report Builder 3.0, which works fine from the Report Viewer itself. In my VB.Net application I have added a Report Viewer control to a form and used some code kindly supplied on the Internet to point to the report etc, but although the form opens nothing is shown on it.
Every example I can find seems to indicate that I have to define the report's datasets in code, but in this case I defined them in the report itself. Is this why it won't work?
Here's the code;
Imports Microsoft.Reporting.WinForms
Public Class frmReportViewer
Private Sub frmReportViewer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim p() As ReportParameter
With ReportViewer1
.ProcessingMode = ProcessingMode.Local
.LocalReport.ReportPath = "C:\Users\Reg\Documents\Visual Studio 2013\Projects\FaSE1\FaSE1\FSEStatement.rdlc"
.LocalReport.ReportEmbeddedResource = "C:\Users\Reg\Documents\Visual Studio 2013\Projects\FaSE1\FaSE1\FSEStatement.rdlc"
Me.ReportViewer1.Refresh()
p(0) = New ReportParameter("partnerstatementid", 14)
p(1) = New ReportParameter("Parameter1", "EASTPOOL")
.LocalReport.SetParameters(p)
.RefreshReport()
End With
End Sub
End Class
Cheers
Reg