Page 1 of 1

TimeSpan column Sum

Posted: Tue Jul 25, 2017 9:53 am
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!

Re: TimeSpan column Sum

Posted: Wed Jul 26, 2017 7:39 pm
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.

Re: TimeSpan column Sum

Posted: Thu Jul 27, 2017 4:20 pm
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!

Re: TimeSpan column Sum

Posted: Fri Jul 28, 2017 2:59 am
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.

Re: TimeSpan column Sum

Posted: Fri Jul 28, 2017 8:37 am
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!

Re: TimeSpan column Sum

Posted: Mon Jul 31, 2017 6:12 pm
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.