×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

schedule reprot export (file .rpt) to pdf

schedule reprot export (file .rpt) to pdf

schedule reprot export (file .rpt) to pdf

(OP)
Hi,

it's possible using vbs to export a report (rpt file) to pdf?
I have this example

Set appl = CreateObject("CrystalRuntime.Application")
Set rep = appl.OpenReport("C:\test.rpt", 1)

rep.EnableParameterPrompting = False
rep.EnableParameterPrompting = False
rep.ExportOptions.DiskFileName = "C:\test.rtf"
rep.ExportOptions.DestinationType = 1
rep.ExportOptions.PDFExportAllPages = True
rep.ExportOptions.FormatType = 4
rep.Export False

but the error is "ActiveX cannot create object"


THANKS

RE: schedule reprot export (file .rpt) to pdf

Which Crystal Reports version are you using? You could use vbscript to run crystal reports on the earlier versions (circa 2005). This facility has not been available since 2008.

I'm quite sure it is just .net now so possibly try powershell. Just look on the net: there are lot of examples on how to do this.

RE: schedule reprot export (file .rpt) to pdf

(OP)
Hi

my crystal report is ver. 11
I need to open rpt file and export data in pdf but I don't know how do that..
:(

RE: schedule reprot export (file .rpt) to pdf

And just to make absolutely sure - Crystal Reports 11 is installed and working fine on the same PC that you are trying to run the VBScript?

RE: schedule reprot export (file .rpt) to pdf

(OP)
yes correct

RE: schedule reprot export (file .rpt) to pdf

And the correct component that provides CrystalRuntime.Application is registered properly (it has been a long time since I used CR, so can't remember what it is called)? I think it is one or both of crystl32.ocx and crviewer.dll

RE: schedule reprot export (file .rpt) to pdf

(OP)
yes..may be I don't know the correct syntax to use..
Do you have a little example that open a report?

Thanks

RE: schedule reprot export (file .rpt) to pdf

Your syntax is fine. It pretty much looks like the problem is the ActiveX control that you need to use.

I suspect that crviewer.dll is either missing or not properly registered. Try sarovinet's solution for fixing this from here

RE: schedule reprot export (file .rpt) to pdf

(OP)
Hi

I don't know I have the same error on a different pc
May be I've to configure the db connection or something like that?

Strange that other people haven't do something like that :(

RE: schedule reprot export (file .rpt) to pdf

>Strange that other people haven't do something like that

I'd suggest that most people are not trying to run a 16 year old version of Crystal Reports!
Or to drive it from VBS, which is documented as being unsupported (the documentation said "It might work, but we don't support it", or something similar, as I recall)
And of those people for whom neither of the above apply, I'd suspect that most have the runtime libraries properly installed, which I am not sure that you do, and which is theoretically addressed in the posyt I linked to in my previous post. Did you try sarovinet's solution?

RE: schedule reprot export (file .rpt) to pdf

(OP)
no it doesn't work..
:(

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close