Hi VB fellows,
I do not want to stump any VB programmer on the issue
that I have faced. This is the problem that looks
simple but no clue to me to fix it. I am sure that
someone met the same problem before and they used same
code I used below.
Thanks,
Joe
--- joezli2000@y... wrote:
> Hi everyone,
> I made an application using VB6.0 and Crystal report
> 8.5 (developer
> edition). The application is required to export the
> RPT report into PDF
> format on the disk without the export prompt.
> Therefore I used the
> following codes to export:
>
> Private Sub ExportUSAA()
> Dim appl As New CRAXDRT.Application
> Dim rep As CRAXDRT.Report
>
> Set rep = appl.OpenReport(App.Path &
> "\DailyAssets-USAA.rpt", 1)
> With rep.ExportOptions
> .Reset
> .DiskFileName = App.Path & "\USAA.PDF"
> .DestinationType = crEDTDiskFile
> .FormatType = crEFTPortableDocFormat '
> Valid max value is 26.
> .PDFExportAllPages = True
> End With
> rep.Export False
> End Sub
>
> However, when I tested the codes, there were two
> issues came up:
> 1. The value of crEFTPortableDocFormat is 31.
> rep.ExportOptions.FormatType
> limit is up to 26. (I tested and identified the max
> value.) An error
> message said
> "Run-time error '5': Invalid procedure call or
> argument"
>
> 2. When I tried the lower value such as
> "crEFTWordForWindows" (value 14),
> the cursor passed ".FormatType
> crEFTWordForWindows" then stopped at
> code "rep.Export False". Error came up "Run-time
> error '-2147891860
> (800473cc)': A number, currency amount, boolean or
> string is expected
> here."
>
> Could anyone give me a clue or clues or possible
> codes to fix the code if
> you had the similar issue before?
>
> (I registerd both exportmodeller.dll and crtslv.dll
> successfully in both
> C:\WINNT\system32\ and C:\WINNT\Crystal.)
>
> Thanks a lot.
>
> Joe
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com