在报表里定义了一个公式字段,需要在vb里传递参数过去?在VB里应该怎么写啊?

解决方案 »

  1.   

    刚刚接触水晶报表9.2 ,很多地方不懂!请各位大侠帮帮忙!!!
    我的代码是这样的,不知什么地方出错了
    Private Sub Form_Load()Dim oApp As New CRAXDRT.Application
    Dim oRpt As CRAXDRT.Report
    Dim reportName As String
    Dim StrTitle As StringStrTitle = "gggg"
    Screen.MousePointer = vbHourglass
    reportName = "\rpt\Pr2.rpt"Set oRpt = oApp.OpenReport(App.Path & reportName, 1)
    'Title是报表的一个公式字段
    oRpt.FormulaFields.GetItemByName("Title").Text = StrTitle oRpt.Database.SetDataSource rs
    oRpt.ReadRecordsCRViewer91.ReportSource = oRptCRViewer91.ViewReport
    Screen.MousePointer = vbDefault
    End SubPrivate Sub Form_Resize()CRViewer91.Top = 0
    CRViewer91.Left = 0
    CRViewer91.Height = ScaleHeight
    CRViewer91.Width = ScaleWidthEnd SubPrivate Sub Form_Unload(Cancel As Integer)
        
        Set rs = Nothing
        
        Set conn = Nothing
        
        Unload Form2
        
    End Sub
    对VB里调用水晶报表9.2