I created a report in a VB.Net application and I’m using the Crystal Reports Viewer control to display it. The report is grouped by a field that’s an integer datatype. I’ve been successful in formatting the field to a string so that it displays properly on the report (i.e., without any thousdand separators or decimals).
The problem now is that when I open the Group Tree in the viewer, the field is being treated as an integer (with the thousand separators). I’ve attempting following the solutions in these articles article1, article2, article3, but they only address formatting the display of the field (which I’m not having a problem with).
So how to I format the display of an integer as string on the Group Tree, not the report itself?
Go into the Group Expert, select your group, and hit “Options”. Select the “Options” tab, and then mark the checkbox that says “Customize Group Name Field” and then select “Use Formula as Group Name” and finally enter the formula
totext({table.field_you_are_grouping_on},0,'')This will change group’s appearance everywhere, including in the tree.Note that the second parameter to
totextcontrols the number of decimals and the third parameter controls the thousands-separator (empty string, in our case).