Summary with DateDiff function

Stimulsoft Reports.NET discussion
Post Reply
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Summary with DateDiff function

Post by Jennypi »

Hi,

One of my reports is buit like this:
-GroupHeaderBand
--DataBand
-GroupFooterBand

In the GroupFooterBand, I have summaries to have group averages of values from the databand.
On of my field is a DateDiff function:

Code: Select all

{DateDiff(data.date_pol,data.date_sowing).Days}
I'm trying to have the average of for this field, like this:

Code: Select all

{Avg(DateDiff(data.date_harvest,data.date_pol).Days)}
but I'm getting an error that reference of an object does not set to an instance of an object.

Where am I wrong? Is it possible to do what I want?

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

Re: Summary with DateDiff function

Post by Ivan »

Hello,

We couldn't reproduce this bug.
Can you please send us a sample report template with data, which reproduce the issue?

Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Re: Summary with DateDiff function

Post by Jennypi »

Hello,

Please find attached my report converted to accept data from csv file, and a data file.
You can see that the field in red color does not work (error is not the same than in the former report, but still).

Thanks for your help.
Attachments
Bureau.zip
(8.38 KiB) Downloaded 171 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Summary with DateDiff function

Post by HighAley »

Hello.
Jennypi wrote:Please find attached my report converted to accept data from csv file, and a data file.
You can see that the field in red color does not work (error is not the same than in the former report, but still).
Please, try to use next expression:

Code: Select all

{Totals.Avg(GroupHeaderBand1, DateDiff(data.date_harvest,data.date_pol).Days)}
Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Re: Summary with DateDiff function

Post by Jennypi »

Thanks, it's working perfectly :)
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Summary with DateDiff function

Post by Andrew »

Hello,

Great! Have a nice day!
Post Reply