Monday, June 21, 2004

Crystal Reports' -- Auto-gen'd code files

After designing a Crystal report file (.rpt), a corresponding code file (.cs in my case) will be generated. Typically, if your report is "Inventory.rpt" then the code file will be "Inventory.cs" Sometimes, however, you will get code file pollution (due to VSS issues, copying between machines, etc.) Crystal's engine will auto-gen another file ("Inventory1.cs" in this case) and the original code file will simply be abandoned. Here's the best way I've found to remedy this problem and reset all the code files to the original names:
  • Delete all code files associated with report files (in this case, delete Inventory*.cs)
  • In Visual Studio, R-click each report file and select the "Run Custom Tool" context menu item
  • Rebuild your solution
Pretty simple.

No comments: