Print Page | Close Window

Format in Group Tree

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6144
Printed Date: 01 May 2025 at 12:14pm


Topic: Format in Group Tree
Posted By: Msarvepalli
Subject: Format in Group Tree
Date Posted: 21 Apr 2009 at 12:50pm
I grouped my report based on the Client Numbers. Client number is a String, but was converted to number format. I could remove the decimals on Group name, but I still see them on the Toggle Group Tree. I am not sure how to change that format.
 
Any thoughts on how I should remove them.
 
Thanks in advance!
 



Replies:
Posted By: DBlank
Date Posted: 21 Apr 2009 at 1:49pm
Under File > Options > Fields Tab
Click on Number
Select NUmber Tab.
Change the default here to to what you want it to look like.


Posted By: Msarvepalli
Date Posted: 22 Apr 2009 at 5:59am
That works!!Smile. Thank you!


Posted By: Msarvepalli
Date Posted: 22 Apr 2009 at 9:55am

Dblank, your suggestion works when I preview the report on crystal, but I could still see the decimals on group tree when I preview the report from Crystal viewer. Not sure how to get those go away!!



Posted By: DBlank
Date Posted: 22 Apr 2009 at 9:59am
You may be stuck with having to use them as a string with the viewer...
Why did you convert from a string to numeric to begin with? Any reason that precludes the use of a string?


Posted By: Msarvepalli
Date Posted: 22 Apr 2009 at 10:09am
Well, the client numbers that we use are not always numeric. Like, they could be 10.0001 or AAA.0003.
 
In my report, I am grouping only client numbers with numeric values though!


Posted By: DBlank
Date Posted: 22 Apr 2009 at 10:13am
How are you excluding the non numeric ones?


Posted By: Msarvepalli
Date Posted: 22 Apr 2009 at 10:20am
I have the files divided into two categories on all reports. Numeric falls under cat1, and non-numberic under cat2. So, I group these numeric files based on formula Int(Val(tablename.filenumber)) and when user chooses cat1 files, they only see this grouping. Hope I am clear!  


Posted By: DBlank
Date Posted: 22 Apr 2009 at 10:22am
Gotcha.
In that case your select statement is independent of the conversion of string to an int so why not just leave it as a string and group on it. This will elminate the trailing .00...


Posted By: Msarvepalli
Date Posted: 23 Apr 2009 at 7:02am
I tried doing that, and now I see each file under its own group. Thanks for your continued support!


Posted By: DBlank
Date Posted: 23 Apr 2009 at 7:30am
Just for clarity you got it to work OK, correct?


Posted By: Msarvepalli
Date Posted: 24 Apr 2009 at 7:01am

No. Let me explain. When I directly use String for grouping, each file is under its own group. Earlier, all files starting with say 10 were under one group, now each file under 10(10.0001, 10.0002, 10.0003,...) is divided into its own group. 10.0001 is under 10.0001 group and 10.0002 under 10.0002 and so on.



Posted By: DBlank
Date Posted: 24 Apr 2009 at 7:17am
Gotcha.
if it is always the first 2 characters that you want to group on then just trim it:
left({table.field},2)
or if there is othe oprions trim it looking for the decimal point
left({table.field},instr({table.field},".")-1)



Print Page | Close Window