![]() |
Click here to advertise with us
|
|
|||||||
| Reporting / Printing Discussion on output-creation components such as reporting, pdf, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am trying to load a crystal report viewer control on my form. This is my code and I get an error. Specified Cast Is Not Valid I know what the error means, but not sure how to find it. Here is my code.
Private Sub frmReportExportPDF_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim DS As New DataSet 'Get the Report Location Dim strReportPath As String = "C:\Malatex\ARS\Reports\PatientCareReport.rpt" 'Check if file exists If Not IO.File.Exists(strReportPath) Then Throw (New Exception("Unable to locate report file:" & vbCrLf & strReportPath)) End If 'Assign the datasource and set the properties for Report viewer Dim rptDocument As New PatientCareReport Try rptDocument.Load(strReportPath) DS.ReadXml("C:\PCRReport.xml") rptDocument.SetDataSource(DS) CRViewer.ReportSource = rptDocument Catch ex As Exception MsgBox(ex.Message) End Try End Sub |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|