Solved

export to pdf using vb and crystal reports

Posted on 2008-10-14
5
457 Views
Last Modified: 2013-12-26
I want to connect to an oracle db and create a report for each record in the table and export it to a pdf file giving it a new file  name. This report has many sub reports (11). I want to use vb 6 and I have 85, 9, 10 and XI versions of Crystal reports
0
Comment
Question by:Bosco2006
  • 2
5 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 125 total points
ID: 22716879
I would look into a 3rd-party tool like

Visual Cut
http://www.milletsoftware.com/Visual_CUT.htm

You can build your own application


Here is the basic code for CR8 using the RDC.  It shpould be close for the versiions you have.
Option Explicit
    Private crApp As CRAXDRT.Application
    Private crRpt As CRAXDRT.Report

'
'   Check if report is already in use
'
    If IsObject(crRpt) Then
       Set crRpt = Nothing
    End If

'
'   Open report
'
    Set crApp = New CRAXDRT.Application

    Set crRpt = crApp.OpenReport("C:\Crystal\MyRepots\My_Report.rpt",1)


'
'   Set Crystal flags
'
    crRpt.EnableParameterPrompting = False
    crRpt.DiscardSavedData

'
'   Set export options
'
    crRpt.ExportOptions.DestinationType = crEDTEMailMAPI
    crRpt.ExportOptions.MailToList = "SomeBody@SomeISP"
    crRpt.ExportOptions.MailSubject = "Todays Crystal Report"
    crRpt.ExportOptions.MailMessage = "Here is the newest report"
    crRpt.ExportOptions.FormatType = crEFTPortableDocFormat

    crRpt.Export False
   
mlmcc
0
 

Author Comment

by:Bosco2006
ID: 22944063
Thanks for the response but I conerted the report to Crystal XI and used C# to export to pdf.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22951510
The code suggested would solve the initial question.

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now