I use the RDC component (I think that's what its called) and I've included code that I used for one of my applications. I use RTF format but you can use the intellisense option in VB to alter some of your properties. Also, my reports are built off stored procedures and I use parameters (you will see below). You can put this code into the click event of a button on a form in order to check it out.
good luck and I hope this helps.
bye
Jim
CODE BELOW:
'you have to add a reference to the Crystal 8.0 Object
'Library from Project--References menu (I forget the exact name of the .dll(s) you have to reference but include the whole library and then figure that out.
''i use the
Dim crxApplication As New CRAXDRT.Application
Dim Report As CRAXDRT.Report
Set Report = crxApplication.OpenReport(App.Path & "\" & sReportName, 1)
''if there are parameters then you will pass them like this:
Report.ParameterFields.Item(1).AddCurrentValue startdate
Report.ParameterFields.Item(2).AddCurrentValue enddate
'set up export options; you will changed to HTML type
''this is specified as rich text format
Report.ExportOptions.FormatType = crEFTRichText
''specify your destination; this saves the file to disk:
Report.ExportOptions.DestinationType = crEDTDiskFile
''since i save to disk you will have to provide and output
''location
Report.ExportOptions.DiskFileName = "c:\temp\output\tst.rtf"
'export the report without prompting the user
'this should start the export automatically; true value
''prompts user for save location (i think)
Report.Export False
''get rid of the object when done
Set Report = Nothing
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.