Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Components & Controls > Reporting / Printing

Reporting / Printing Discussion on output-creation components such as reporting, pdf, etc.

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-12-2010, 6:06 PM
VB.NET Forum Newbie
.NET Framework: .NET 2.0
 
Join Date: Dec 2009
Posts: 14
Reputation: 5
jimmyray is on a distinguished programming path ahead
Default Help loading Crystal Reports Viewer Control

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 10:57 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.