Crystal报表未在应用程序中显示

时间:2014-07-16 05:54:33

标签: vb6 crystal-reports

我有一个功能,我用来在我的应用程序中显示水晶报告。一切都很好,直到昨天下午,现在它只显示一个空白的窗口。但它没有给出任何错误。在水晶报表设计师中,它在预览时显示值。我正在使用存储过程从DB中检索值。这是我的代码

Public Sub ShowReport(ParamArray reportParameters())
    On Error GoTo Catch

    Dim NTOT As Integer
    Dim nCtr As Integer
    Dim LoopCount As Integer
    Dim ReportPath As String

    Open App.Path & "/Reports.txt" For Input As #1
    Input #1, ReportPath
    Close #1

    ReportPath = ReportPath & "\Reports\" & reportParameters(0)
    'MsgBox ReportPath
    Screen.MousePointer = vbHourglass

    With frmReports.Crpt
        .Reset
        .WindowTop = 0
        .WindowLeft = 0
        .ReportFileName = ReportPath

        '.RetrieveStoredProcParams
        For LoopCount = 3 To UBound(reportParameters)
            .StoredProcParam(LoopCount - 3) = reportParameters(LoopCount)
        Next

       .WindowTitle = reportParameters(1)
       .ReportTitle = reportParameters(1)
       .WindowParentHandle = frmReports.hwnd
       .WindowShowSearchBtn = True
       .WindowShowPrintSetupBtn = True
       .WindowShowRefreshBtn = True
       .WindowShowProgressCtls = True
       .WindowShowZoomCtl = True
       .WindowShowGroupTree = True
       .WindowAllowDrillDown = True
       .ProgressDialog = True
       .PageZoom (100)
       .WindowState = crptMaximized

       If reportParameters(2) = "P" Then
           .Destination = crptToPrinter
       Else
           .Destination = crptToWindow
       End If
       .Action = 1
End With

Screen.MousePointer = vbNormal

Exit Sub
Catch:
    Screen.MousePointer = vbNormal
End Sub

我使用VB6和水晶报告版本是8 这段代码有什么问题?任何人都可以找到这个

的解决方案

0 个答案:

没有答案