Solved

export to pdf using vb and crystal reports

Posted on 2008-10-14
5
461 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 101

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 101

Expert Comment

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

mlmcc
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

How to increase the row limit in Jasper Server.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

688 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