0

执行以下代码时,我在客户端机器上收到上述错误

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;  

路径和表存在。连接到没有子报表的报表时,上述代码也会失败。

我不明白为什么给我的登录参数不正确,因为它们只是表格。在其他机器上它工作得很好。有任何想法吗?

4

1 回答 1

0

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.

于 2010-10-28T06:29:08.330 回答