Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Expert 2

Status
Not open for further replies.

cuneyt

Programmer
Mar 3, 2003
42
AU
When I first design the report, I didnt choose a formula field cuz which was not exist that time, then I created a formula field and I wanna sort my fields according to that field, then from Report -> Sort Records, I'm looking for the choose it, but it's not there, then I found out that I can only add it there from Report Expert but when I do that my whole report design messes up as u all know...

Question: Is there a way to keep my design and add a formula field to the Report expert or at least into Sort Records...

Thanx in advance
 
Formula fields are generally available for sorting. Please post your formula in its entirety so we can see why it is not available.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
numberVar dur := Sum ({ado.DURATION}, {ado.TYPEOFTARIFF});
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

hhmmss := totext(hrs, "00") + ":" + totext(min, "00") + ":" + totext(sec, "00");
 
Hi Cuneyt,
Yes, You should be able to select it under Report, Sort Records... does your formula exist on the report? If not, try adding the formula to the report, then go to Report, Sort Records... and you should see your formula. You can either delete the formula after you use it to sort by or suppress so it doesn't show.

Just FYI, You can create formulas in the Report Expert during the initial report creation phase, on the field tab one of the buttons below the database fields is formula.
Good luck,
Jacque
 
fellows, i'd like to show u screen shots, please dont talk to me as I am a dummy, i know what u guys mean, i'm doing a mistake in somewhere but it's in surface, please try to take it deeper...

thanx
 
fellows, i'd like to show u screen shots, please dont talk to me as I am a dummy, i know what u guys mean, i'm doing a mistake in somewhere but it's not in surface, please try to take it deeper...

thanx
 
Cuneyt,
That was definitely not my intention if that is how you took my reply/posting.
Jacque
 
Jacque,
I know you want to help, abd I am very appreciated you guys cuz of that...

You can see the code above and I can see Duration field that is orduced by those codes of formula then I've checked Sort Records under Reports but still I cant see my formula field there,

I'm thinkin that whether CR 8.5 have option to show or not show formulas in Sort Records... I dont think so but I cant see any type of formula there that is written by me after report created, of course I can solve this problem creating a new report and write that formula first but that's not the point...

I dont think anyone wants to create a report again and again just to insert a new formula and wants to sort by this formula

Thanx...
 
I don't think second pass formulas will be available in the Sort dialog.



Bob Suruncle
 
CUNYET -

This formula is not available for sorting because it contains a "Summary Function" in it.

numberVar dur := Sum ({ado.DURATION}, {ado.TYPEOFTARIFF});

Show us how you want the report to look and we shall see if there are alternative ways...for example Top-N may work for you.

Jim Broadbent
 
Thanx Jim,
Extension Area Type # of Calls Duration

2810 N 11 00:23:42
2813 I 6 00:07:35
2813 L 26 00:38:16
2813 N 8 00:25:05
2814 L 13 00:14:28
2814 N 6 00:07:04
2815 L 7 00:06:31
2815 N 20 01:04:24
2816 I 9 00:12:28
2816 N 28 01:42:10
---for 1st record, that means 2810 made 11 National calls and its total 23 min. 42 sec. (i want to sort that total field)

ok fellows, this is how my report looks like, I'm grouping it according to extension and area type, so I'm getting count of extensions (as number of calls) and sum of duration for those extensions... But i cannot sort my record according to Duration, cuz it sorts in each extension and area, for example in first one it sorts 11 records inside this group... ny the way u may think it is detail section but it is actually group footer...

On the other hand what I want looks like so easy but I'm just stacked, u know it happens sometimes... What I want to do is simply; sorting the duration area that is grouped by Extension and Area Type.

Question: How am I gonna sort according to duration field, so i want it to look like this:

Extension Area Type # of Calls Duration

2815 L 7 00:06:31
2814 N 6 00:07:04
2813 I 6 00:07:35
2816 I 9 00:12:28
2814 L 13 00:14:28
2810 N 11 00:23:42
2813 N 8 00:25:05
2813 L 26 00:38:16
2815 N 20 01:04:24
2816 N 28 01:42:10

Cuneyt
 
Try Top-N but we will play around with it a bit

************************
numberVar dur := Sum ({ado.DURATION}, {ado.TYPEOFTARIFF});
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

hhmmss := totext(hrs, "00") + ":" + totext(min, "00") + ":" + totext(sec, "00");
*****************************************

I copied your original formula for easier reference...this formula can be left alone as it is and displayed (but not grouped on or sorted on.

So....we are going to Group on Duration but you want the group to be based on the sum of the duration (ascending)




Jim Broadbent
 
thanx everybody but that's enuf, either u dont get me or I'm not capable to understand u guys but thanx for giving it a try...

see u guys in other thread
 
Sorry I misclicked

to continue

We DON'T group on Duration! Rather we group on {ado.TYPEOFTARIFF}


Go to your report menu and select

Report|TopN/Sort Group expert

In the Drop down list select Top N of sum of {ado.DURATION}

Then select Ascending and that should do it

Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top