
Please Help Newbie Crystal Report / VB help needed.
First of all what happens with the code below? And second if Crystal
Reports is you default app for RPT files, why not shell the rpt file?
Furthermore when I work with Crystal inside VB I also throw in the follwoing
code for robustness
CrystalReport1.DataFiles(0) = DatabasePath
'just to tell the control where to find the data for the specified report.
This is also done in you rpt though.
Steve Easy
Quote:
>I need to be able to browse any *.rpt file which I got working not clicking
>then I need to start Crystal Report control and start the report. Can
anyone
>help Please here is the code:
>I have a common Dialog control named dlgCommonDialog
> CrystalReport1 control
>Private Sub Form_Load()
> Dim sFile As String
> With dlgCommonDialog
> .DialogTitle = "Open Crystal Report"
> .CancelError = False
> 'ToDo: set the flags and attributes of the common dialog control
> .Filter = "All Reports (*.rpt)|*.rpt"
> .ShowOpen
> If Len(.FileName) = 0 Then
> Exit Sub
> End If
> sFile = .FileName
> End With
> CrystalReport1.ReportFileName = sFile
> CrystalReport1.Action = 1
>End Sub