Gentlemen, i have a problem in my Crystal Report, I'm really appreciate if anyone can help me,
my trouble is
1. message box of type mismatch always shown when i click print button, but the data which i want to print is right that shown in my crystal report.
What i did recently:
1. i design my crystal report in vb 6.0 by add crystal report in my project
2. i had make the data type in my crystal report design same as data type in my database
3. recently i use this technique to show my data in crystal report
Private Sub cmdPrint_Click()
Call Buka
Dim pil1 As New ADODB.Recordset
Dim sql1, pilihan1, strdata As String
Dim a1, b1 As Date
Dim cetak As New PageSet.PrinterControl
a1 = tglawal.Value
b1 = tglakhir.Value
pilihan1 = cbpilihan.Text
Adodc1.ConnectionString = Conn
Set cryApp = New CRAXDRT.Application
Select Case pilihan1
Case "All"
sql1 = "select m.no_faktur,m.pemohon,m.peminjam, b.nama ,d.jumlah_mnt,d.jumlah_app,d.tgl_pnjm,d.tgl_kmbl,d.approve,d.keterangan from dtl_pinjam d inner join dtl_barang b on d.id_barang = b.id_barang inner join mspeminjaman m on d.no_faktur = m.no_faktur order by d.no_faktur asc;"
Case "Tanggal"
sql1 = "Call viewpnjmbytgl('" & a1 & "','" & b1 & "')"
Case "Belum disetujui"
sql1 = "Call viewpinjamblmck"
Case "Disetujui"
sql1 = "Call viewpinjambyapp"
Case "Ditolak"
sql1 = "Call viewpinjambyrjct"
End Select
Adodc1.RecordSource = sql1
Adodc1.Refresh
CRpeminjaman.Database.SetDataSource Adodc1.Recordset
PrintPreview.CRViewer1.ReportSource = CRpeminjaman
PrintPreview.CRViewer1.ViewReport
PrintPreview.CRViewer1.Zoom 100
PrintPreview.Show
PrintPreview.WindowState = 2
End Sub
what i still confuse:
1. what must i do to trace that type mismatch error? i had check my CR design, data type in my database, my query that run well.
2. is Date format is really impact to this? my CR design is DATETIME, n my db design is DATETIME too such as dd/mm/yyyy h:mm:ss
3. is null field is really impact too? some of my field is null.