怎么使用crystal9中的非绑定字段,我建了一个,可是不知道怎么把vb中的变量传给它。

解决方案 »

  1.   

    ' Bind the five unbound fields to the newly added data source
        With m_Report
            .UnboundString1.SetUnboundFieldSource "{Orders.Ship Via}"
            .UnboundCurrency1.SetUnboundFieldSource "{Orders.Order Amount}"
            .UnboundBoolean1.SetUnboundFieldSource "{Orders.Shipped}"
            .UnboundNumber1.SetUnboundFieldSource "{Orders.Customer ID}"
            .UnboundDate1.SetUnboundFieldSource "{Orders.Order Date}"
        End With
        
        ' Do some runtime formatting of the number and date unbound fields
        ' to make the report look more appealing
        m_Report.UnboundNumber1.DecimalPlaces = 0
        With m_Report.UnboundDate1
            .HourType = crNoHour
            .MinuteType = crNoMinute
            .SecondType = crNumericNoSecond
            .AmString = ""
            .MonthType = crShortMonth
            .YearType = crLongYear
            .DateFirstSeparator = " "
            .DateSecondSeparator = ", "
        End With
     
        ' View the report
        CRViewer1.ReportSource = m_Report
        CRViewer1.ViewReport
    具体查看水晶报表例子-Unbound_Fields
      

  2.   

    范例不能运行,提示“未启用创建功能”。
    请问有没有使用正版Crystal9的用户,烦请试试水晶报表例子-Unbound_Fields能不能运行,以排除软件版本问题,谢谢。