Symptom
When opening a report with a field name that ends with an underscore and used in a Group, the report fails to load in a Windows .NET CR for VS application and generates the following internal Exception error:
{"Error in formula name 'm ({Table.Amount}, {Table.No_}', reserved characters '{', '}', '@', '?' cannot be used in formula name."}
Environment
Crystal Reports for Visual Studio SP 19 and SP 20 ( tested )
Reproducing the Issue
Resolution
This issue has been reported to R&D and they asked for the issue to be assigned to them to resolve.
After R&D had a closer look at the issue it was determined something in the Group field name reference was invalid.
Simply changing the group to some other field and then back again resolved the issue.
NOTE: The Report designer is a design tool and it does allow "bad" formula and other references to be saved. As long as the field is not used it can stay there. Which is why the report worked in the Designer.
The SDK on the other hand expects the report to be 100% valid, any un-used Tables, Fields, formula, etc. that are not required should be removed from the Report before using in an application. This is also true when publishing to Businessobjects Enterprise or Crystal Reports Server products.
Keywords
cr for vs, innerexception, .net, crystal reports, "_", underscore , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem