Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 PDF CrystalReports
Hi
 
I have a vb6 application to export a particular crystal to a pdf format. I Wrote the following code in button click event.
 
    Dim crxApplication As CRAXDDRT.Application
    Dim oReport As CRAXDDRT.Report
    Dim crxExportOptions As CRAXDDRT.ExportOptions
    Dim myDatabase As String
    
    Set crxApplication = New CRAXDDRT.Application
    Dim crxTable As CRAXDDRT.DatabaseTable
   
    Set oReport = crxApplication.OpenReport(App.Path & "\sample.rpt", 1)
    oReport.FieldMappingType = crAutoFieldMapping
    For Each crxTable In oReport.Database.Tables
        crxTable.SetLogOnInfo servername, Database, userid, password    
    Next    
   
    Set crxExportOptions = oReport.ExportOptions
    crxExportOptions.DestinationType = crEDTDiskFile
    crxExportOptions.DiskFileName = App.Path & "\MyReport.pdf" 
    crxExportOptions.FormatType = crEFTPortableDocFormat
    crxExportOptions.PDFFirstPageNumber = 1
    crxExportOptions.PDFLastPageNumber = 1
    crxExportOptions.PDFExportAllPages = True
    oReport.Export False
 
It works fine. but while i click the button the following warning message occurs.
The database file "tablename" has changed. Proceeding to fix up the report!
I verified the crystal report and save it. While directly open crystal report file it works finely. please help to overcome this warning
 
[edit]Spurious tags removed, title, code block added - OriginalGriff[/edit]
Posted 13-May-12 22:06pm
Edited 13-May-12 22:10pm
v2
Comments
ShaikhM at 15-May-12 0:00am
   
What happens when you try to export the report to PDF from Crystal report itself? Any error?
Also does any part of your code adds or changes any fields from the "tablename" at runtime?
As an alternative try running a different dummy report that uses the same "tablename"
Kschuler at 15-May-12 11:48am
   
What version of Crystal Reports are you using?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please open report in crystal report designer and verify database from menu. Please check it.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 210
2 BillWoodruff 205
3 Jochen Arndt 180
4 Sergey Alexandrovich Kryukov 165
0 OriginalGriff 5,130
1 DamithSL 4,157
2 Maciej Los 3,650
3 Kornfeld Eliyahu Peter 3,460
4 Sergey Alexandrovich Kryukov 2,811


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 22 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100