Blog Stats
  • Posts - 14
  • Articles - 0
  • Comments - 14
  • Trackbacks - 0

 

Thursday, September 17, 2009

Error:'This field name is not known' in Crystal Report when using a SQL View

I got this error on production for a report which was working fine in Dev and it took me a while to figure out the cause.

Report's Data Source was pointing to a SQL Server View, when I looked at the SQL Query ( Database - > Show SQL Query ), I noticed that Database name was there with view name: "DbName.dbo.ViewName"

I did a lot of googling, trying to figure out a way to change this behaviour and have just "dbo.ViewName" in SQL, but in vain.

For now, I have fixed it by putting the SQL in the view within a Command in Crystal Report and its working.

Its kind of OK for this report as view had a small SQL and report is pretty small.

 

I would love to find REAL solution though, Crystal Reports does not always put the DBName with View.

 

 

Copyright © faizanahmad