dear friends,
i'm confuse to create a good code to connect
vb to crsytal report.
basicly, i wanna relate a report (design in crystal report/extension .rpt) using
vb code. i use OLEDB Method to connect them.
these are my codes :
-----------------------------------------
Private Sub Form_Load()
Dim crxDB As CRAXDRT.Database
Dim crxReport As CRAXDRT.Report
Dim crxApp As CRAXDRT.Application
Dim strSQL As String
Dim strFormula As String
Dim strOutlet As String
Dim strStartDate As String
Dim strEndDate As String
Screen.MousePointer = vbHourglass
strSQL = "SELECT * FROM SALES_VIEW"
g_adoRst.Open strSQL, g_adoCnn, adOpenDynamic, adLockPessimistic, adCmdText
Set crxApp = New CRAXDRT.Application
Set crxReport = crxApp.OpenReport("C:\Program Files\Business Objects\Crystal Reports 11\Samples\en\Reports\TCPOS\ArticleSales.rpt", 1)
Set crxDB = crxReport.Database
crxDB.SetDataSource g_adoRst, 3, 1
CRViewer.ReportSource = crxReport
crxReport.DiscardSavedData
CRViewer.ViewReport
Screen.MousePointer = vbDefault
End Sub
---------------------------
i've got an error in this syntax
crxDB.SetDataSource g_adoRst, 3, 1
the error from
vb is : invalid TLV Records...
i have no idea about this.
thanks for helping me...
freezh