Solved

export to pdf using vb and crystal reports

Posted on 2008-10-14
5
458 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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…
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…

808 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