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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crosstab and time format summation?

Status
Not open for further replies.

mart1000

MIS
May 23, 2007
39
GB
I am using Crystal XI

I have data showing in seconds. I created a formula called ' @non-available HH:MM 'to convert to time format as below :



WhilePrintingRecords;
StringVar Hours;
StringVar Minutes;
//StringVar Seconds;
NumberVar nonavailactivityscheduled;


nonavailactivityscheduled:={AccumulatedWeekdaySPActuals.Non-Available Scheduled};

If nonavailactivityscheduled < 0 Then
"Cannot have a time less than zero"
Else
(Hours:=ToText(Truncate(nonavailactivityscheduled/3600),0);
Minutes:=ToText(Truncate(Remainder(nonavailactivityscheduled,3600)/60),0);
// Seconds:=ToText(Remainder(Remainder(nonavailactivityscheduled,3600),60),0));

//Display the time formated.
(if length(Hours) < 2 then '0') + Hours + ":" +
["0",""][length(Minutes)] + Minutes )


My issue is aswell as showing as report listing I also want to create a crosstab - I can show summarised data in seconds format but how can I either convert this to the time format or bring in the above formula into the crosstab - I cant see the formula prob becasue summation ot ime cannot be done

This would be a useful solution for a number of reports

thanks in advance
 
You will have to do the summary using the seconds value but you can use the "Display String" formatting feature to convert the seconds value into the formatted time string to display in the cross-tab.

Look in the function list of the "Display String" formula editor for the formatting function called CurrentFieldValue. Use that as your formula input. You will need to do this for every cell position (do it in design mode) but you can use the format painter to copy the display string to all the other cells.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top