Daspoo
Well-known member
Crystal Reports/ASP.NET question
Hey all. Ive got an ASP.NET project going here based on loading a crystal report and viewing it using the Crystal Reports Web Viewer. I have a question concerning a problem Im facing...
Has anyone experienced attempting to pass parameters for a report and then handling subreport parameters that are linked to a field for the datasource of the report? In other words, I have a report that is based on a stored procedure, and it also has a subreport which is also based on a stored procedure. The subreport is linked to the main report, i.e., it has a parameter ("?Pm-") that is linked to a field in the main report (and not a main report parameter). Does anyone have any ideas how to handle passing a value to this linked parameter, or do you not have to do so? Im a bit clueless here. Ive played around with the issue, but I end up with the following error message each time I attempt to pass parameters and view the report:
==============================================
Server Error in /WebAppCrystalRevisit Application.
------------------------------------------------------------------
Error in File c:\Reports\CpyInventoryCtrl.rpt: Operation illegal on linked parameter.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.ParameterFieldException: Error in File c:\Reports\CpyInventoryCtrl.rpt: Operation illegal on linked parameter.
Source Error:
Line 176:
Line 177: Apply the parameter value to the report document (** exporting **)
Line 178: rptDoc.DataDefinition.ParameterFields(pNumber).ApplyCurrentValues(currValues)
Line 179:
Line 180: End Sub
Source File: c:\inetpub\wwwroot\WebAppCrystalRevisit\CrystalObjectClass.vb Line: 178
Stack Trace:
[ParameterFieldException: Error in File c:\Reports\CpyInventoryCtrl.rpt:
Operation illegal on linked parameter.]
.K(String
, EngineExceptionErrorID )
.F(Int16 , Int32 )
.E(Int16 )
CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition.ApplyCurrentValues(ParameterValues currentValue)
WebAppCrystalRevisit.CrystalObjectClass.SetParameter(Int32 pNumber, String dValue) in c:\inetpub\wwwroot\WebAppCrystalRevisit\CrystalObjectClass.vb:178
WebAppCrystalRevisit.frmParameters.Proceed(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebAppCrystalRevisit\frmParameters.aspx.vb:290
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
------------------------------------------------------------------
Version Information:
Microsoft .NET Framework Version:1.0.3705.288;
ASP.NET Version:1.0.3705.288
==============================================
Any assistance with this would be most appreciated! Thanks in advance.
P.S. - Ive posted the same question in the Crystal Decisions forum for Crystal Reports for VS.NET...

Hey all. Ive got an ASP.NET project going here based on loading a crystal report and viewing it using the Crystal Reports Web Viewer. I have a question concerning a problem Im facing...
Has anyone experienced attempting to pass parameters for a report and then handling subreport parameters that are linked to a field for the datasource of the report? In other words, I have a report that is based on a stored procedure, and it also has a subreport which is also based on a stored procedure. The subreport is linked to the main report, i.e., it has a parameter ("?Pm-") that is linked to a field in the main report (and not a main report parameter). Does anyone have any ideas how to handle passing a value to this linked parameter, or do you not have to do so? Im a bit clueless here. Ive played around with the issue, but I end up with the following error message each time I attempt to pass parameters and view the report:
==============================================
Server Error in /WebAppCrystalRevisit Application.
------------------------------------------------------------------
Error in File c:\Reports\CpyInventoryCtrl.rpt: Operation illegal on linked parameter.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.ParameterFieldException: Error in File c:\Reports\CpyInventoryCtrl.rpt: Operation illegal on linked parameter.
Source Error:
Line 176:
Line 177: Apply the parameter value to the report document (** exporting **)
Line 178: rptDoc.DataDefinition.ParameterFields(pNumber).ApplyCurrentValues(currValues)
Line 179:
Line 180: End Sub
Source File: c:\inetpub\wwwroot\WebAppCrystalRevisit\CrystalObjectClass.vb Line: 178
Stack Trace:
[ParameterFieldException: Error in File c:\Reports\CpyInventoryCtrl.rpt:
Operation illegal on linked parameter.]
.K(String
, EngineExceptionErrorID )
.F(Int16 , Int32 )
.E(Int16 )
CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition.ApplyCurrentValues(ParameterValues currentValue)
WebAppCrystalRevisit.CrystalObjectClass.SetParameter(Int32 pNumber, String dValue) in c:\inetpub\wwwroot\WebAppCrystalRevisit\CrystalObjectClass.vb:178
WebAppCrystalRevisit.frmParameters.Proceed(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebAppCrystalRevisit\frmParameters.aspx.vb:290
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
------------------------------------------------------------------
Version Information:
Microsoft .NET Framework Version:1.0.3705.288;
ASP.NET Version:1.0.3705.288
==============================================
Any assistance with this would be most appreciated! Thanks in advance.
P.S. - Ive posted the same question in the Crystal Decisions forum for Crystal Reports for VS.NET...

Last edited by a moderator: