在vb.net里会产生几个参数用于AR7报表的script里面使用,我之前使用的方法是:
在VB.net里面抽出的数据放在DataTable,在循环给报表里的字段:
rpt1.DataMember = dateRt100.TableName
rpt1.DataSource = dateRt100
For j = 0 To dateRt100.Rows.Count - 1
rpt1.Fields("Fact_Cd").Value = dateRt100.Rows(j)("Fact_Cd").ToString
rpt1.Fields("transport_cd").Value = dateRt100.Rows(j)("transport_cd").ToString
rpt1.Fields("Bos_Cd").Value = dateRt100.Rows(j)("Bos_Cd").ToString
rpt1.Fields("Haisya_No").Value = dateRt100.Rows(j)("Haisya_No").ToString
rpt1.Fields("RecordSet").Value = dateRt100.Rows(j)("RecordSet").ToString
rpt1.Fields("DateTime").Value = dateRt100.Rows(j)("DateTime").ToString
Next
在AR7报表的script 的头部使用get,set进行取值:
Public Property Fact_Cd() As Object
Get
Return varFact_Cd
End Get
Set(ByVal vNewValue As Object)
varFact_Cd = vNewValue
End Set
End Property
Public Property transport_cd() As Object
Get
Return varTransport_Cd
End Get
Set(ByVal vNewValue As Object)
varTransport_Cd = vNewValue
End Set
End Property
Public Property Bos_Cd() As Object
Get
Return varBos_Cd
End Get
Set(ByVal vNewValue As Object)
varBos_Cd = vNewValue
End Set
End Property
Public Property Haisya_No() As Object
Get
Return varHaisya_No
End Get
Set(ByVal vNewValue As Object)
varHaisya_No = vNewValue
End Set
End Property
Public Property RecordSet() As Object
Get
Return objRec
End Get
Set(ByVal vNewValue As Object)
objRec = vNewValue
End Set
End Property
Public Property DateTime() As String
Get
Return strDate
End Get
Set(ByVal vNewValue As String)
strDate = vNewValue
End Set
End Property
但是运行之后还是没有取到值,请各位大神求救!! |
|