views:

38

answers:

1

Hi

I am getting the above error on a client's machine when executing the following code

for i := 0 to crpe.Subreports.Count - 1 do  
  for j:=0 to crpe.Subreports[i].Tables.Count - 1 do  
    crpe.Subreports[i].Tables[j].Path := path;  

crpe.Subreports[0];   {This line points the VCL back to the main Report}  

for i := 0 to crpe.Tables.Count - 1 do  
  crpe.Tables[i].Path := path;  

The path and the tables exist. The above code also fails when connecting to a report with no subreports.

I cannot see why it is given me incorrect log on parameters as they are just tables. On other machines it works just fine. Any ideas?

A: 

Try removing the fourth line

(crpe.Subreports[0]; {This line points the VCL back to the main Report} )

Try it first on a machine where your program seems to be working, to see if you really need the line.

If that works, then try it on the client's machine to see if it makes a difference.

That line of code does not make any sense. It just references an object, but does not assign it or use it. Why isn't it causing a compiler error?

-Al.

A. I. Breveleri
HiThank you for the reponse.Although the line looks wrong especially when you do not have any sub-reports it is needed to give back focus to the main report. If I don’t include the line and I have sub-reports then the report opens on one of the sub-reports.The only work around at the moment was to ask the client to try to use another computer and this worked but obviously it would be nice to find out the cause of the problem in the first place in case it happens again.
jose alsina