Hi, I have a problem with pass parameter value to crystal
report with stored procedure, in this case i have to pass
COLID(type= Uniqueidentifier) that refer to parameter in the
crystal report based on stored procedure. I have try to
pass..but it still no data show on my activex viewerI use RAS SDK
on my server.thx
Hope reply soon.....thx a lot
FIle Attached below
If Flag = "Personnel" Then
Sub PassParameter(strParamName, ParamValue)
'Determine the index position of the parameter in the report
ParamIndex = Session("oClientDoc").DataDefinition.ParameterFields.Find(strParamName, 0)
'Get parameter in the report at the position ParamIndex
Set objParam = Session("oClientDoc").DataDefinition.ParameterFields.Item(ParamIndex)
'Clone the parameter object so we can modify it
Set objNewParam = objParam.Clone
'Add parameter field value to this object
objNewParam.CurrentValues.Add ParamValue
'Insert the modified parameter back into the report
Session("oClientDoc").DataDefController.ParameterFieldController.Modify ParamIndex, objNewParam
End Sub
' The included sample report has a parameter for each type of value in Crystal Reports
' Pass the parameter values by name to the report - the subroutine expects
' the following arguments: Parameter Name, Parameter Value
' The subroutine also works for multi-value discrete parameters
PassParameter "@PM_EMPLOYEECOLID", Cstr("aa")
End If
Change it to
Code:
Sub PassParameter(strParamName, ParamValue)
'Determine the index position of the parameter in the report
ParamIndex = Session("oClientDoc").DataDefinition.ParameterFields.Find(strParamName, 0)
'Get parameter in the report at the position ParamIndex
Set objParam = Session("oClientDoc").DataDefinition.ParameterFields.Item(ParamIndex)
'Clone the parameter object so we can modify it
Set objNewParam = objParam.Clone
'Add parameter field value to this object
objNewParam.CurrentValues.Add ParamValue
'Insert the modified parameter back into the report
Session("oClientDoc").DataDefController.ParameterFieldController.Modify ParamIndex, objNewParam
End Sub
' The included sample report has a parameter for each type of value in Crystal Reports
' Pass the parameter values by name to the report - the subroutine expects
' the following arguments: Parameter Name, Parameter Value
' The subroutine also works for multi-value discrete parameters
If Flag = "Personnel" Then
PassParameter "@PM_EMPLOYEECOLID", Cstr("aa")
End If
i still have a problem when i try to pass parameter value to crystal report with stored procedure. It shows an error like this "clientdoc.dll error 800200b" - Unknown error
Sub PassParameter(strParamName, ParamValue)
'Determine the index position of the parameter in the report
ParamIndex = Session("oClientDoc").DataDefinition.ParameterFields.Find(strParamName, 0)
==>>an ERror Point to This Line
'Get parameter in the report at the position ParamIndex
Set objParam = Session("oClientDoc").DataDefinition.ParameterFields.Item(ParamIndex)
'Clone the parameter object so we can modify it
Set objNewParam = objParam.Clone
'Add parameter field value to this object
objNewParam.CurrentValues.Add ParamValue
'Insert the modified parameter back into the report
Session("oClientDoc").DataDefController.ParameterFieldController.Modify ParamIndex, objNewParam
End Sub
%>
If Flag = "Personnel" Then
PassParameter "@PM_EMPLOYEECOLID", Cstr("aa")
End If
<!-- #include file="ActiveXViewer.asp" -->
<Form>
<INPUT TYPE = "hidden" name = "Report">
<INPUT TYPE = "hidden" name = "Flag">
<INPUT TYPE = "hidden" name = "EmployeeCOLID">
</Form>
hi , sorry bout my last post and for your correction on the "If statement" , i've did the report work now, but there is another problem now, The COLID that i will pass through the parameter value is Uniqueidentifier data type, so...maybe that's the problem the parameter value not pass to my report.
So everytime open my report on my asp page, just preview my default value not the value that I pass from my ASP page.
I've read from crystaldecision about passing the parameter through stored procedure with uniqueidentifier, about how to convert them in the stored procedure. Just like i Said , if i prompt a value manually in the crystal report designer it works correctly.....but it just like that even i pass a value from asp page.....
thx a lot anyway for helping me much..cause i get weird....
Last edited by endrue; December 8th, 2003 at 10:08 PM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.