Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Error: Specified Cast is invalid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nancy. - 15 Oct 2004 20:57 GMT
Hello:
Hope you can help me.
Below is the code in Windows Forms VB to Export
the "Notifications.rpt" Crystal reports to PDF.  This
report is connected to a dataset.
The    oRptNOTE.Export() line is failing.  I am not sure
why.  

Dim oRptNOTE As Notifications
       oRptNOTE = New Notifications
       oRptNOTE.SetDataSource(Dataset12.notification)
       Dim DiskOpts As
CrystalDecisions.Shared.DiskFileDestinationOptions = New
CrystalDecisions.Shared.DiskFileDestinationOptions
       oRptNOTE.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
       oRptNOTE.ExportOptions.ExportFormatType =
CrystalDecisions.
[Shared].ExportFormatType.PortableDocFormat
       DiskOpts.DiskFileName = "c:\temp\test2.pdf"
       oRptNOTE.ExportOptions.DestinationOptions =
DiskOpts
       oRptNOTE.Export()
Nancy. - 18 Oct 2004 13:39 GMT
I posted the subject issue last Friday.  Instead I find
the following as an original message.  
>-----Original Message-----
>Message unavailable

The issue I wrote is the following:
This is the code that converts a document to a pdf format.
Data is in a dataset format.
The error message is generated from this line:
       oRptNOTE.Export()
If I display the information in the Crystalreports viewer
it works; however it does not if programmatically I want
to export to a pdf.
Thanks in advanced.
Nancy.

Dim oRptNOTE As Notifications
       oRptNOTE = New Notifications
       oRptNOTE.SetDataSource(Dataset12.notification)
       Dim DiskOpts As
CrystalDecisions.Shared.DiskFileDestinationOptions = New
CrystalDecisions.Shared.DiskFileDestinationOptions
       oRptNOTE.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
       oRptNOTE.ExportOptions.ExportFormatType =
CrystalDecisions.
[Shared].ExportFormatType.PortableDocFormat
       DiskOpts.DiskFileName = "c:\temp\test2.pdf"
       oRptNOTE.ExportOptions.DestinationOptions =
DiskOpts
       oRptNOTE.Export()

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.