Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing values to a report

Status
Not open for further replies.
Aug 28, 2003
18
CA
I am running Crystal Enterprise 10 Embedded edition and am trying to run a report from ASP. I am using the following code:
*************************
<%
reportname = "wmsal001.rpt"
%>
<!-- #include file="AlwaysRequiredSteps.asp" -->
<%

Set NewValue = objFactory.CreateObject("CrystalReports.ParameterFieldDiscreteValue")
NewValue.Value = 1
Set TempParam = objFactory.CreateObject("CrystalReports.ParameterField")
ClientDoc.DataDefinition.ParameterFields.Item(0).CopyTo TempParam
TempParam.CurrentValues.Add NewValue
ClientDoc.DataDefController.ParameterFieldController.Modify ClientDoc.DataDefinition.ParameterFields.Item(0), TempParam

%>
<!-- #include file="CrystalReportsViewer.asp" -->
******************************

This works fine but when I modify the 'NewValue.Value = 1' line to read 'NewValue.Value = request.form("SiteID")' , I get the following error:

*******************************
Error Type:
webReporting.dll (0x80004005)
Error in File C:\WINNT\TEMP\{FC91B826-6F0A-46FA-96E1-93BA3A048629}.rpt: The specified value type is different to the current value type.
/reports/CrystalReportsViewer.asp, line 20
*********************************

I am new to this so I'm not sure if there is a way to pass variables from another web page via it's form fields.

Any ideas?
 
Found the Problem.

Turns out it was variable type problem. Used the following line with success:

NewValue.Value = CInt(request.form("SiteID"))

Need to make sure the variable is of matching type.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top