Question

In a report, I have to implement timespan fields (For example duration of an activity). At the end of the report, a summary based on it should be included. Neither Crystal Reports nor Active Reports support TimeSpan fields. I don't want to use any formula or other workarounds. Simply just show the TimeSpan fields (like 1:45, 45:23, 0:30) and show the summary at the end (like 109:20).

Any suggestion?

Was it helpful?

Solution

It is difficult to say for sure without knowing more information such as why you don't want to use formulas and whether this is a TimeSpan data type in SQL Server or it is stored in some other way in the database, or being calculating somehow (e.g. in application code), etc...

Without more information though, a formula is the right way to solve this in ActiveReports as well as Crystal Reports. Since you need a summary, in ActiveReports (where I have the most experience) I'd say the best way to do this is bring in the timespan value as a single numeric value as number of minutes. This will allow you to use the normal no-code ActiveReports summarization features as described here.

Then to format the number into the desired output text use a formula in the DataField property of the TextBox such as: =Math.Floor(Minutes/60) + ":" + (Minutes % 60). More information about using formulas in the DataField property is here and here.

Scott Willeke
GrapeCity

OTHER TIPS

Try my ElapsedTime() function; use it with the summary field's Display String formula.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top