环境:VB6+Crystal Reports 9
我的报表是调用存储过程,有两个参数
我从CSDN文档中看到的用法,写了下面语句:
'***************************************
Private Sub Command1_Click()
    CrystalReport1.ReportFileName = App.Path + "\Report1.rpt"
    MsgBox CrystalReport1.ReportFileName
    CrystalReport1.StoredProcParam(0) = DTPicker1.Value
    CrystalReport1.StoredProcParam(1) = DTPicker2.Value
    CrystalReport1.WindowState = crptMaximized
    CrystalReport1.WindowTitle = "HELLO"
    iRet = CrystalReport1.PrintReport
    If CrystalReport1.LastErrorNumber > 0 Then
        MsgBox CrystalReport1.LastErrorString
    End If
End Sub
'****************************************错误是:Unable to load report我应该怎样写才对呀?

解决方案 »

  1.   

    '***************************************
    Private Sub Command1_Click()
        CrystalReport1.ReportFileName = App.Path + "\Report1.rpt"
    CrystalReport1.open
        MsgBox CrystalReport1.ReportFileName
        CrystalReport1.StoredProcParam(0) = DTPicker1.Value
        CrystalReport1.StoredProcParam(1) = DTPicker2.Value
        CrystalReport1.WindowState = crptMaximized
        CrystalReport1.WindowTitle = "HELLO"
        iRet = CrystalReport1.PrintReport
        If CrystalReport1.LastErrorNumber > 0 Then
            MsgBox CrystalReport1.LastErrorString
        End If
    End Sub
    '****************************************
      

  2.   

    CrystalReport1.open这句就出错了!