Skip to Content
0
Former Member
Jun 03, 2010 at 06:43 AM

CommandTable returning as Procedure

28 Views

Hi all. Got something strange going on here. I'm writing an app that will search through the SQL in all of our reports (all of our reports are written using a single Command object). Some of the reports for some reason are returning their tables as CrystalReports.Procedure, rather than CrystalReports.CommandTable. Trying to cast it to the latter expectedly causes an invalid cast exception. I've double-checked the ones doing this, and there is only one table behind each report, and each one is indeed a Command.

While playing around for possible solutions, I ended up tidying up some of the code in one of the reports; I didn't make any real changes to anything, just prettied up the code some. One of the things I did was to replace any instances of 4 spaces with a single tab character. And suddenly, it's now seeing it as a CommandTable for that report. I'm assuming it has something to do with a size limit of the CommandText, but I can't find anything documented anywhere on this.

Is this a known issue, and is there any workaround, aside from cleaning up all the code? Main thing I'm concerned about is that if this is indeed caused by hitting a limit for the CommandText, doing some code beautification on the offending reports may work for some, but may not work for others with exceptionally long complex queries. Thanks in advance for any assistance.