Solved

export to pdf using vb and crystal reports

Posted on 2008-10-14
5
455 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
Comment Utility
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
Comment Utility
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
Comment Utility
The code suggested would solve the initial question.

mlmcc
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

771 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

8 Experts available now in Live!

Get 1:1 Help Now