I am using Cryatel Report 8.5 wiht a subreport in VB 6 , Both Report & Subreport use same stored procedure with paremeters.
I face problem to pass subreport's paremeters through VB6
i am using the fillowing code for call report
-----------------------
CR_RedoRepCall.Connect = CN
CR_RedoRepCall.ReportFileN
ame = App.Path & "\Reports\RED_Aging_Flag_S
ummary_new
.rpt"
CR_RedoRepCall.ReplaceSele
ctionFormu
la ("")
If txtCustName <> "" Then
sSql = "select dbo.Cust_Name(null," & "'" & txtCustName & "')"
rs.Open sSql, CN
custname = rs.Fields(0)
CR_RedoRepCall.Formulas(0)
= "CustName = '" & custname & "'"
Else
CR_RedoRepCall.Formulas(0)
= "CustName = '" & "" & "'"
End If
If txtParentID <> "" Then
sSql = "select dbo.Cust_Name(null," & "'" & txtParentID & "')"
rs2.Open sSql, CN
custname = rs2.Fields(0)
CR_RedoRepCall.Formulas(1)
= "ParentName = '" & custname & "'"
rs2.Close
Else
CR_RedoRepCall.Formulas(1)
= "ParentName = '" & "" & "' "
End If
CR_RedoRepCall.Formulas(2)
= "REDO_Reason = '" & ParentName & "' "
CR_RedoRepCall.Formulas(3)
= "Sub_Reason = '" & SubCategoryName & "' "
CR_RedoRepCall.ParameterFi
elds(1) = "@VehCat;" & catg & ";True"
CR_RedoRepCall.ParameterFi
elds(2) = "@CustId;" & txtCustName & ";True"
CR_RedoRepCall.ParameterFi
elds(3) = "@Prod;" & Prod & ";True"
CR_RedoRepCall.ParameterFi
elds(4) = "@CustType;" & Cust & ";True"
CR_RedoRepCall.ParameterFi
elds(5) = "@ParentCustId;" & txtParentID & ";True"
CR_RedoRepCall.ParameterFi
elds(6) = "@RedoBranch;" & Branch & ";True"
CR_RedoRepCall.ParameterFi
elds(7) = "@RedoBranchName;" & BranchNmae & ";True"
CR_RedoRepCall.ParameterFi
elds(8) = "@ProdName;" & ProdName & ";True"
CR_RedoRepCall.ParameterFi
elds(9) = "@VehCatName;" & CatgName & ";True"
CR_RedoRepCall.ParameterFi
elds(10) = "@ReasonID;" & Parent & ";True"
CR_RedoRepCall.ParameterFi
elds(11) = "@ReasonSubID;" & SubCategory & ";True"
'CR_RedoRepCall.ReportSour
ce
Dim crSec As CRAXDRT.Section
CR_RedoRepCall.Action = 1
-----------------------
Where CR_RedoRepCall is the Name of CR ActiveX control.
Now, How can i pass the subreport's perametes ?
Start Free Trial