Click to See Complete Forum and Search --> : Crystal Reports Automation


goddess_spanky
October 15th, 2001, 07:59 PM
How do i use the crystal reports add-ins for visual basic? i basically want a report to run from a vb app (not using the viewer) and export that report direclty to a file (adobe pdf). I've read thru some of the help files that come with crystal reports, but i'm still lost.
Any advice?

~goddess
goddess_spanky@hotmail.com

K.Babu
October 16th, 2001, 03:40 AM
hi

you can select export formate form the available list of PrintFileType property,

and assign PrintFileName property to export file name,

then assign destination property to rptfile

This will directly export to file without preview.

Babu.

MailID: k_babs@hotmail.com

goddess_spanky
October 18th, 2001, 10:38 AM
Do you have a code sample of how to do this? I need to see how it is done from start to finish (like creating the cyrstal report object, etc.)

Thanks!

~goddess
goddess_spanky@hotmail.com

pavankiran
November 19th, 2001, 03:32 AM
Hi,

I am also looking out for some sample program, incase you found some thing can u tell me about it.

Regards,
kiran.

Shiv Kumar G.M.
November 19th, 2001, 03:41 AM
'Here you have to check out for the formattype, then set it to PDF file.
Private Sub command1_Click()
Dim Report as New CrystalREport1
Report.ExportOptions.FormatType = crEFTText
Report.ExportOptions.DestinationType=crEDTDiskFile
Report.ExportOptions.DiskFileName = "FileName"
Report.Export False
End Sub

andre748
November 21st, 2001, 12:17 PM
Here some additional stuff:

' Set the reportname
CrystalReport1.ReportFileName = strReportname
' To send an (additional) selection
CrystalReport1.ReplaceSelectionFormula (strSelect)
' To print the report
' First you have to define the way of printing
' (to a file, to screen or to the printer)
CrystalReport1.PrintReport

If you have the Crystal component you can use the object browser to view the properties and methods. Good luck.