开发者

How to feeding Crystal Report 8.5 parameters from VB6.0 Application?

How to feeding Crystal Report 8.5 parame开发者_如何学Cters from VB6.0 Application?


Here is one way of doing it (assuming that crxRpt points to a valid report object):

Dim crxParam as CRAXDRT.ParameterField
For Each crxParam In crxRpt.ParameterFields
    Select Case crxParam.Name
        Case "{?MyStringParam1}"
            crxParam.AddCurrentValue "Parameter1 value"
        Case "{?MyNumberParam2}"
            crxParam.AddCurrentValue 25.35
    End Select
Next crxParam


Use the GetItemByName(ByVal Name As String, Optional ByVal SubreportName As Object = Nothing) As CRAXDDRT.ParameterFieldDefinition method. Once you have the ParameterFieldDefinition object, the world is your oyster.


here is the way to pass parameters to RPT via CRviewer

Set Report = Appl.OpenReport(App.Path & "MyReport.rpt")
CRViewer1.ReportSource = Report

Report.Database.Tables.Item(1).SetLogOnInfo CnDNS, CnDB, CnUser, CnPwd
Report.EnableParameterPrompting = True
Report.DiscardSavedData
Report.ParameterFields(1).ClearCurrentValueAndRange
Report.ParameterFields(1).AddCurrentValue ParameterValue1
Report.ParameterFields(2).ClearCurrentValueAndRange
Report.ParameterFields(2).AddCurrentValue ParameterValue2
Report.ParameterFields(3).ClearCurrentValueAndRange
Report.ParameterFields(3).AddCurrentValue ParameterValue3
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜