Page 1 of 1

Filtering by Date

Posted: Thu Dec 22, 2016 4:15 pm
by AlexK
Hi,

1. I'm trying to filter data in DataBand by setting the date in format "dd.MM.yyyy", which is used in Russia.
The filter doesn't work. When I set the date in format "MM.dd.yyyy", it works fine.

I've set both (1) the report's Culture = Russian (ru-Ru), and (2) AutoLocalizationOnRun = true, still the filter doesn't work for "dd.MM.yyyy" format.

2. Also, how can I use the date in filtering expression?

Code: Select all

Activity.PlannedFinishDate >= "21.11.2016" && Activity.PlannedFinishDate <= "25.11.2016" 
The code above doesn't work, due to the error: Operator '>=' cannot be applied to operands of type 'System.DateTime' and 'string'

Thank you.

Re: Filtering by Date

Posted: Fri Dec 23, 2016 1:32 pm
by HighAley
Hello.

In your expression you compare the date with a string. Do you have the data as a string? In other way you should get a error.
You should use the DateTime variable to compare the dates or use the simplified interface.

Thank you.

Re: Filtering by Date

Posted: Fri Dec 23, 2016 4:01 pm
by AlexK
I've solved most of my issues. Just to inform others who will face the similar problems:

The right way of using date in filtering expressions:

Code: Select all

Activity.PlannedFinishDate >= new DateTime(2016, 11, 21)
Still, is it possible to use "dd.MM.yyyy" date format in the simplified interface?
"MM.dd.yyyy" works fine, but this format isn't conventional for our users.

Thank you.

Re: Filtering by Date

Posted: Sun Dec 25, 2016 7:49 pm
by Alex K.
Hello,

Can you please send us simple report with test data which reproduces the issue with date formatting for analysis.

Thank you.

Re: Filtering by Date

Posted: Mon Dec 26, 2016 8:55 am
by AlexK
Hi Aleksey,

There are report and source files in attachment.
The steps to reproduce my issue are in the header of the report.

Thank you.
Test.mrz
Report file
(2.1 KiB) Downloaded 391 times
Test.xlsx
Source for the report
(9.12 KiB) Downloaded 357 times

Re: Filtering by Date

Posted: Wed Dec 28, 2016 6:35 am
by Alex K.
Hello,

We couldn't reproduce this bug. Could you explain your issue in more details?

Also, please check modified report.

Thank you.