Crystal Report Parameters from Delphi: Error 656

Posted on 2003-03-17
Medium Priority
Last Modified: 2010-05-19
New to Delphi and Crystal Report, maintaining a Delphi application interfacing to Crystal Reports.

A couple of report interfaces from Delphi are having parameter problems as follows:

Calls to PEGetNParameterFields and PEGetNthParameterField indicate more parameters than I can find in the .rpt file. In one instance the parameters are repeated such that the names of the first 4 parameters returned from PEGetNthParameterField equal the names of the next 4. PEGetNParameterFields said 8 parameters and I can only find the 4 in the .rpt file. In the other instance I find 8 parameters in the .rpt file and PEGetNParameterFields and PEGetNthParameterField reveal 12 with the first 8 as expected and the last 4 different to any of the 8.

In both cases calls to PESetNthParameterField, one past the number of parameters I see in the .rpt (the logic looping for the number got from PEGetNParameterFields) produce the 656 error which I see in Crystal Help described as "Operation illegal on linked parameter."

I don't understand where PEGetNParameterFields and PEGetNthParameterField are getting their info. from and why it should differ with where PESetNthParameterField is aimed. Any help greatly appreciated.
Question by:matthewmiddleton
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 101

Accepted Solution

mlmcc earned 225 total points
ID: 8158546
Does your report have a subreport?  If so does the subreport require parameters?


Author Comment

ID: 8170732
You were on the right track. The get gets all parameters. The logic was then putting values into the "main" parameters, ignoring the subreport parameters but then looping through all the parameters performing the Set for each. When doing a Set the crash occurred on those subreport parameters that take their input from things (parameters I think) on the main report, the ones the logic had ignored. Essentially the code looked like:


   //do some stuff to specific ParamFields


I solved the problem by altering that to:


   //do some stuff to specific ParamFields

   for cnt := (NewReport.Crpe1.ParamFields.Count - 1)downto 0 do
     if not NewReport.Crpe1.ParamFields[cnt].NeedsCurrentValue then


Thanks for your comment.

Author Comment

ID: 8170744
Not the answer but would have got me going in the right direction if I hadn't figured the same myself in the meantime...quick response to
LVL 101

Expert Comment

ID: 8171017
Glad to help


Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question