Results 1 to 2 of 2

Thread: [ASK] Type mismatch in Crystal report, vb6.0, CR 7.0

  1. #1

    Thread Starter
    New Member kaito1412's Avatar
    Join Date
    Apr 2013
    Posts
    4

    Exclamation [ASK] Type mismatch in Crystal report, vb6.0, CR 7.0

    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.
    2. my CR doesn't refresh if i change the case condition

    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
    Code:
    Private Sub cmdPrint_Click()
    Call Buka
    On Error Resume Next
    Dim sql1, pilihan1, a1, b1, c1, d1 As String
    Dim cetak As New PageSet.PrinterControl
    a1 = tglawal.Value
    b1 = tglakhir.Value
    c1 = Format$(a1, "yyyy / mm / dd")
    d1 = Format$(b1, "yyyy / mm / dd")
    pilihan1 = cbpilihan.Text
    Adodc1.ConnectionString = Conn
    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('" & c1 & "','" & d1 & "')"
                                   
                                    
                    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
                    'CRpeminjaman.DiscardSavedData = True
                    PrintPreview.CRViewer1.ReportSource = CRpeminjaman
                    PrintPreview.CRViewer1.PrintReport
                    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. i have try by add 'CRpeminjaman.DiscardSavedData = True in my code, or uncheck ‘Save Data With Report‘, but still not work
    3. is Date format is really impact to this? my CR design is DATETIME, n my db design is DATETIME too such as yyyy/mm/dd hh:mm:ss

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: [ASK] Type mismatch in Crystal report, vb6.0, CR 7.0

    Moved to the Reporting forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width