Print Page | Close Window

export problems

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18243
Printed Date: 28 Apr 2024 at 11:32am


Topic: export problems
Posted By: smoky
Subject: export problems
Date Posted: 12 Dec 2012 at 5:44am
Hallo, I'm working with VB 6 and crystal 11.2 Iwoild like to export a report direct without looking at it or printing. Who can help. My code follows:               Set crApplication = New CRAXDRT.Application

Set crReport1 = crApplication.OpenReport(App.Path & "\BerichteCrystal10\ElsterBilanzAPGV.rpt", 1)

crReport1.DiscardSavedData
crReport1.Database.SetDataSource adoRS

'CRViewer1.ReportSource = crReport1
'CRViewer1.ViewReport

If fs.FolderExists(Pfad & "\Elster" & FirmenNr & "") = False Then
    fs.CreateFolder (Pfad & "\Elster" & FirmenNr & "")
End If

If fs.FolderExists(Pfad & "\Elster" & FirmenNr & "\Elster" & Bilanzjahr) = False Then
    fs.CreateFolder (Pfad & "\Elster" & FirmenNr & "\Elster" & Bilanzjahr)
End If

If fs.FileExists(Pfad & "\Elster" & FirmenNr & "\Elster" & Bilanzjahr & "\ElsterBilanz_" & Bilanzjahr & ".ttx") = True Then
    fs.DeleteFile (Pfad & "\Elster" & FirmenNr & "\Elster" & Bilanzjahr & "\ElsterBilanz_" & Bilanzjahr & ".ttx")
End If

Dim FileName As String
FileName = "" & Pfad & "\Elster" & FirmenNr & "\Elster" & Bilanzjahr & "\ElsterBilanz_" & Bilanzjahr & ".ttx" crReport1.ExportOptions.FormatType = crEFTTabSeparatedText
crReport1.ExportOptions.DestinationType = crEDTDiskFile
crReport1.ExportOptions.DiskFileName = FileName
crReport1.Export
Many thanks in advance from Germany SMOKY








-------------
smoky



Print Page | Close Window