TimeSpan column Sum

Stimulsoft Reports.WEB discussion
Post Reply
Simergia
Posts: 4
Joined: Thu Mar 09, 2017 5:14 pm

TimeSpan column Sum

Post by Simergia »

Hello,

I have a TimeSpan column with this format:

Format = new Stimulsoft.Report.Components.TextFormats.StiTimeFormatService() { StringFormat = "HH:mm:ss:fff" };

But, the Summary row only shows the value "HH:mm:ss:fff" instead of the summatory of the all values.

How to configure the Summary for the TimeSpan columns?

Thanks!
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: TimeSpan column Sum

Post by HighAley »

Hello.

Could you send us more information about the issue.
Where do you use this code?
Please, send us a sample project.

Thank you.
Simergia
Posts: 4
Joined: Thu Mar 09, 2017 5:14 pm

Re: TimeSpan column Sum

Post by Simergia »

Hello,

For example, you have a list of this type of object:
class Test
{
public string Name
{get;set;}
public TimeSpan Time
{get;set;}
}

If you create a report with two columns, Name an Time, and you add Summary for Time column:

StiText TxtSummary = new StiText(new RectangleD(x, y, width, height));
TxtSummary .Name = Guid.NewGuid().ToString();
TxtSummary .Text = "{Totals.Sum(DataBandName ,"Data.Time")}";
TxtSummary .TextFormat = new Stimulsoft.Report.Components.TextFormats.StiTimeFormatService() { StringFormat = "HH:mm:ss:fff" };

the report only shows the value "HH:mm:ss:fff" instead of the summatory of the all values of Time property.

Thanks!
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: TimeSpan column Sum

Post by Ivan »

Hello,

Please check the following article:
https://docs.microsoft.com/en-us/dotnet ... at-strings

Please use the correct format string:

Code: Select all

hh\:mm\:ss\:fff
Thank you.
Simergia
Posts: 4
Joined: Thu Mar 09, 2017 5:14 pm

Re: TimeSpan column Sum

Post by Simergia »

Hello,

I have changed the format but the summary doesn't works.

Can you give a sample with a TimeSpan Summary, please?

Thanks!
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: TimeSpan column Sum

Post by HighAley »

Hello.

We can send you a sample with TimeSpan that will work.
But we need to reproduce your issue to help you.
Please, send us more detailed information about your issue.

Thank you.
Post Reply